Entering math in Bricscad instead of entering direct values


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.


  • 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

    Start of line:(- 1024.0 (* 3.0 79.42))
    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

    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.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!