Entering math in Bricscad instead of entering direct values

Hi,

I'm new to Bricscad, actually, I'm pretty new to cad drawing in general. Up until now I have mainly used Sketchup for drawing professional projects (furniture, home cinemas, sound studios).

In cnc-programming I'm used to enter math instead of values. For instance, the start position of a line could be 1024-3*79,42.

Is there a way to enter math in Bricscad where you would normally enter a value? When you draw a line, you can enter 1024/5 for instance, but 100+100 doesn't work.

Comments

  • I used to do so and liked entering math in number fields too before Bricscad.
    AFAIK, so far it is not possible in Bricscad.

  • @Michael Mayer said:
    I used to do so and liked entering math in number fields too before Bricscad.
    AFAIK, so far it is not possible in Bricscad.

    Did you used to do this in other cad software? As far as I know, Autocad doesn't allow it.

    When I think of it, it is actually pretty weird if this isn't possible.

  • I'm not sure about Microstation in the far past but I use to do it often in Vectorworks
    and Modo, maybe Nemetschek Allplan, Archicad and C4D too (?)
    I always thought this would be standard.

    OK, if not available in Autocad, no wonder if it isn't in Bricscad.

  • Richard Webb
    edited April 2021

    Use a LISP expression where you would ordinarily enter a simple number. LISP takes a little getting used to, and I'm a mere novice compared to some of the code-slingers on here, but this is a case where a little knowledge is useful.

    For example, at the command line

    L
    Start of line:(- 1024.0 (* 3.0 79.42))
    785.74
    Start of line:785.74

    General syntax ( [binary operator] [argument] [argument]).

    LISP will "cast" the arguments to / (division operator) to floating point if at least one argument is float but (/ 5 3) uses strictly integer math, so the result is 1. Muscle memory to always stick a decimal on all numeric values is useful.

    Edit to add: To get an actual 2D or 3D point, not a simple numeric result, return a "list" to the prompt. Syntax (list [point] [point]) or the 3D equivalent. For example

    L
    Start of line or [Follow] :(list (- 1024.0 (* 3.0 79.42)) 0)
    (785.74 0)

  • In Autocad, I use 'cal (the apostrophe allows it to be called transparently ie. whilst another command is running), I believe Bricscad does have the same option. The cal command allows some really powerful calculations well worth looking at.

  • Wow I never knew

  • The numeric keypad on my keyboard doubles as a calculator, which can send whatever's currently in its display to the system as if it were typed on the keypad. Never needed that with other cad programs, but very useful in Autocad-world.

    It's handy in word processing too. You can write 563 x 37 = 20831, sending the numbers at each step, so it does the calculation while you're writing the calculation, and it makes sure there's no mistake.

    It has an extra row of keys across the top, and an LCD display above that. The first of those extra keys toggles it between keypad and calculator mode. Then there's AC (don't know what that does), then ClearEntry, and then Send.

    The keypad just to the left of the numeric keypad has some extra keys too: M+, M-, MR, %, and 1/x. When it's in keypad mode, the LCD display shows the date.

    It's a Focus FK-9200. I bought it for the 12 extra function keys it has above the regular function keys. I don't use those much any more, but I use the calculator a lot.

    I think Focus went out of business 20 years ago. Their keyboards were expensive, but designed for work rather than gaming. I don't think there's anything like it now, except that you can buy remote numeric keypads that do the same thing, such as the Kensington K72274US and the Gembird KPD-CU1.

  • Thanks for the response. For now I can't get the suggestions to work, but as said, I'm a novice.

    To be honest I don't understand why this isn't a basic thing in cad drawing. Why is it limited to 'divide'?
    I'm no software developer, but it doesn't seem like a hard thing to implement, while it is extremely useful.

    Is Bricsys reading along? :-)

  • @Arno said:Why is it limited to 'divide'?

    Have you seen top left, click on the bars and lots of variant options incl 'scientific' which has all the functions you could need. And graphing - must play with that. Wonder if it takes input from a spreadsheet. Powerful capabilities. Oh, and it's a Microsoft ap.

  • @Arno said:
    To be honest I don't understand why this isn't a basic thing in cad drawing. Why is it limited to 'divide'?

    If your question is regarding my caution up above, entering points and values via LISP is not limited to divide. Rather, the caution is to emphasize that LISP assumes integer math and that may cause unexpected behavior when a division operation is performed if one is not aware of the default.

    For example, (+ 5 3) returns 8, as expected; (- 5 3) and (* 5 3) return 2 and 15, respectively, However, (/ 5 3) returns 1, which is correct for integer math but quite likely not what was intended.

    The tale of why LISP and not some other API goes far back into the mists of time. It's an odd but powerful little language; LISP is actually not the acronym for Lots of Irritating Superfluous Parentheses, much as that may seem appropriate. Then there's cadr, cddadr, caadar, etc; that way lies madness...

  • It could be feasible to do some string calcs converting formula to lisp, there are some good mapcar functions that do like what you want, pretty sure have had a go at calculator lisp recognises simple + - * /

    (setq p2 (mapcar '+ p1 (list X Y 0.0))) x and y being offset values.

    (setq mp (mapcar '* (mapcar '+ p1 p3) '(0.5 0.5))) find mid

    (setq pt3 (mapcar '(lambda (x) (/ x 2.0)) pt3) divide by 2

    Like others I have been using lisp for 40 years so would work out a pt1 pt2 then it becomes line !pt1 !pt2 Enter when typed on the command line.

    Some commands support transparent calls like CAL in autocad, so could write some of the functions, a obvious one is "m2p"
    Line m2p pick 2 points.

    If you could describe the functions required but more which commands you would use them with who knows what free time someone may have.

    Please NOTE the correct way you must have a X and Y value if formulas to be used either being blank or 0.

  • I appreciate the effort, but to be honest it's too complicated. As I stated I'm a beginner to cad drawing, and I'm not really interested in complicated solutions.

    Maybe I haven't been clear about what I wish the software could do.

    Let's say I drew a square 500x500mm. Now I typ L and press enter. A starting point is required. I place the crosshairs over one of the corners of the square and click. Now an endpoint is required. I drag the mouse along one of the sides of the square to give the direction of the line. Now I have to enter a value for the lenght of this line. I can enter a direct value, and I can enter say, 500/3. But I can't enter 500/3-(30+0.7) or any other math. I know I can grab a calculator, but I honestly don't get why this is not a basic thing in such high end software. Especially while dividing ís an option.

    I have years of experience with cnc-software for woodworking, and many of those applications allow whatever formula you throw at it, anytime a value is asked.

  • @Arno said:
    it's too complicated.

    Agreed. I used to use 'cal too but haven't found it to work in Bricscad (just brings up separate calculator app on Windows for me, instead of command line tool). I'm getting better at remembering the integer lisp division, but wish math could just be entered in a non-reversed notation. Bricscad handles math expressions easily for parametric constraints, so it must be possible to extend to other commands.

    File a feature request with support, and I will do the same. Speaking of math, it would also be nice to have TeX integrated into mtext, tables, attributes, etc.

  • @ScottS said:

    File a feature request with support, and I will do the same.

    Good suggestion! Did it.

  • I think Bricscad 3d has a very elegant and intuitive feel to it. The option of entering math without hassle would suit the application really well.

  • For simple division its not bad (/ 500 3.0)
    bit harder
    (- (/ 500 3.0)(+ 30 0.7))

  • @Arno said:

    @ScottS said:

    File a feature request with support, and I will do the same.

    Good suggestion! Did it.

    Function will not be available anytime soon.

  • Don't feel like you are alone in this need. I've been after the Bricscad folks since version 12 to do this. Sadly, every response I get has been arrogant or they just don't 'get it' at all. C'mon programmers: This really isn't rocket science!

    FWIW: GeneriCADD had this feature back in 1993, but sadly, AutoDesk bought them out and promptly discontinued support for the program (grrrrr). It had a fair complement of math functions: add [+], subtract [-], multiply [*], divide [/], six trig functions [sin(), cos(), tan()], power [^], Logbase10 [log10()], angular conversion (radians-degrees, radians-gradians, degrees-gradians), absolute value [ABS()], Pi, and operational parenthesis (). It also allowed angles in Degrees, ArcMinutes ArcSeconds (23d 15' 45s; ' for Minutes to prevent confusion with Miles or Meters, and s for seconds to prevent confusion with " for inches). All of it could be nested, and for scripts where you were prompted for values, the response value variables could be used anywhere in the math string. I think at the time it had a limit of 255 characters in a string, but that was in the ancient times of 8 bit compilers.

    The coding to do this is already integral to their software (think: feet, inches, & fractions), they just don't bring it to the surface.

    My prompt, again, to the Bricscad team is to allow a set of characters that would allow units conversion on the fly:
    1. If I am working in Imperial Units (Inches) and need to add a metric dimensioned part (this happens all the time), I could just enter 23mm to get the radius of a 23mm hole rather than having to enter 230/245 (because Bricscad won't allow a decimal in a fraction like 23/25.4 grrrrr! THAT NEEDS FIXED, too! decimals and fractions should be valid responses for any prompt that is not strictly an integer value!).

    2. Similarly, if I am entering an Imperial dimension in a Metric drawing, I could just enter 23" or 23in and get the metric equivalent.

    3. It already does this for Feet and Inches to convert everything to inches, so why not allow 25m 6cm 4mm to sum to 25,064 mm for situations where you are entering metric (granted, this would be unusual for a native metric user, but still useful to some, and if you entered this in a native inch drawings it should do the math summing AND the conversion). For entering Miles (mi), mils (mil), microns (u), light years (ly), angstroms (a or ang), chains (ch), fathoms (fa), yards (y), furlongs (fu), or any of the other thousands of length descriptors around the world, it would make life much easier.

    4. I suggest that they make the conversion table a user accessible spreadsheet so people could enter whatever conversions they wanted (yeah, I know "DANGER WILL ROBINSON", but you never know what other conversions someone might need):
    It would have 4 columns:
    the key (or key symbol string) or symbol, Imperial to Metric factor, Metric to Imperial factor, and a comment field
    mm 2.54 0.444444444444 Converts inches to millimeters and millimeters to inches

    Where the conversion one way is EXACT and the conversion the other way is irrational, then leaving the entry blank (like the 0.4444.... above), the program would know to use the inverse of the other value (the the computer is good at this and it removes the human error of rounding).

    So, here it is AGAIN Bricscad team. Please don't make any more excuses for not including BASIC FUNCTIONALITY like this. JUST DO IT. The last time you responded there were all sorts of suggestions for LISP, Diesel, and other 'work-arounds'. We don't want or need 'work-arounds' -- we need fast methods of data entry that are easily done on-the-fly with little mystery to the user without having to call-up other software.
  • ALANH
    edited March 2022
    3. It already does this for Feet and Inches to convert everything to inches,
    You can do your own front end in a lot of situations needing this task, you enter a string "10 3 1/4" and it becomes decimal much faster than typing 10' 3 1/4" The classic is DDD.MMSS very simple for degs min's secs.

    Pretty sure something about enter feet and inches and do a convert on it was recently at forums/autodesk something about alternative units.

    Whilst it wont necessarily help there are a few type plain maths and work out the answer lisp out there. Pretty sure + - / * is out there. I know I had a look at convert a formula to lisp code and it had a heap of functions in it.

    Here are 2 not tested. Apologise don't have authors name in them.

  • Don't feel like you are alone in this need. I've been after the Bricscad folks since version 12 to do this. Sadly, every response I get has been arrogant or they just don't 'get it' at all. C'mon programmers: This really isn't rocket science!.

    Well stated.

    -Joe
  • The feet v's metric of course is not black and white but a shade of grey, I work metric, I ask for a piece of benchtop timber say 1' x 6' I dont get 304.8 x 1828 I get a piece 300 x 1800. There is still a lot of stuff that has not converted some 25mm tube say is actually 25.4 but its becoming less available, we can still buy a 3/8" whitworth bolt.
  • Joe Dunfee
    edited April 2022
    Note that regarding entering of feet and inches. The official way to display that is 4'-1 1/2". Note the dash after the ' and before the whole fraction. But, AutoCAD, when it was first created, used the space bar as equal to the enter key. So, to the detriment of every new draftsman, they decided to have the dash be moved, so that entry is in the form of 4'1-1/2".

    But, BricsCAD really should allow entry in any format. If the units are set to, for instance, meters, you don't need to use the m. But, if you want a different unit that what the drawing is set to use, just enter the unit. So, if set to m, but you want inches, type 5".

    Regarding math. Perhaps to avoid breaking other AutoCAD routines, have a special key to start the math function when prompted for a value. E.g. MATH 3*4. or even M 3*4, if no one sees a problem with a single letter. Perhaps standardize on Excel format for math.

    -Joe
  • > If the units are set to, for instance, meters, you don't need to use the m. But, if you want a different unit that what the drawing is set to use, just enter the unit.


    I always thought it would be possible in Bricscad.

    But maybe I just mixed that up with Vectorworks or Modo,
    because by default Bricscad adapts units shown in DYNDIMs
    depending on dimension - like changing from Millimeter to Meter.
    But when you enter a number without giving a unit - it will input
    in INSUNITS anyway.

    I use Math a lot in Vectorworks.
    Like in the Object Info Palette (Properties Palette), I may take the
    value and do a *2 or /3, or add or subtract a 1.20 m from it.
    But opposed to VW, as Bricscad is a real destructive Modeler in 2D and 3D,
    there isn't much editing in Properties possible anyway.
    So the Math has to be done by yourself and directly manipulated by PushPull
    or such tools.
  • Hmmh,
    I tested and for me, the Unit conversion works in Bricscad.
    INSUNITs mm.
    I can enter "4m" in DYNDIM and it will move 4,000 mm.
    I can also enter 5' and it move my Face 1,524 mm.
  • I am still on v14, so my experience is not current.
  • @Erich Friend thank you for reviving this thread. It led me to discover the unit conversion definition file, default.unt (apparently similar to acad.unt), that is customizable although practically undocumented.
    @Joe Dunfee, do you have default.unt in v14 support path? It was in v15; I don't know earlier.
    Anyway, I'm not sure how it's implemented other than lisp command cvunit. I can confirm what @Michael Mayer tested with Dynamic Input, but typing out the unit name fails (e.g. "meter" or "metre" or plurals), and so does entering in the command line (with DYNMODE < 1) in v22.
  • Have a special key that is 'cal in acad

    Thinking though you can type lisp into a question, I want a circle with area of 10sq units I want to draw that circle in cad without reaching for my calculator.

    CIRCLE pickpt (sqrt (/ 10.0 pi))
    will draw the circle with correct radius.