hexagon logo

Keeping Expression Values Only

It's amazing what you can learn when you pick up literature on "down time" (when you're bored.)....


I've always wondered if Pc-Dmis could solve expressions, in the Edit window on the fly like Solidworks, Mastercam, or most CAD/CAM software. Well, in PcDmis it's not as straight forward as other software BUT it's possible

ex...1+2 evaluates to 3. In Pcdmis, you would have to hover your mouse over the expression 1+2 to see what it evaluates to.

Solution: Use the ` (tilde) symbol before an expression (tilde symbol is located below the ESC key on a US qwerty keyboard)

CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
            THEO/<[COLOR=#FF0000]`1+2[/COLOR],0,0>,<0,0,1>,0.25
            ACTL/<0,0,0>,<0,0,1>,0.25
            TARG/<0,0,0>,<0,0,1>
            START ANG=0,END ANG=360
            ANGLE VEC=<0,0,-1>
            DIRECTION=CCW
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=YES
              NUMHITS=4,DEPTH=0.075,PITCH=0
              SAMPLE METHOD=SAMPLE_HITS
              SAMPLE HITS=0,SPACER=0.06
              AVOIDANCE MOVE=NO,DISTANCE=0.2
              FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
            SHOW HITS=NO


Quickly evaluates to

CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
            THEO/<[COLOR=#FF0000]3[/COLOR],0,0>,<0,0,1>,0.25
            ACTL/<0,0,0>,<0,0,1>,0.25
            TARG/<0,0,0>,<0,0,1>
            START ANG=0,END ANG=360
            ANGLE VEC=<0,0,-1>
            DIRECTION=CCW
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=YES
              NUMHITS=4,DEPTH=0.075,PITCH=0
              SAMPLE METHOD=SAMPLE_HITS
              SAMPLE HITS=0,SPACER=0.06
              AVOIDANCE MOVE=NO,DISTANCE=0.2
              FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
            SHOW HITS=NO




EDIT: does not work on ASSIGN/ command.
  • I use this frequently when typing in move point coordinates. It's very handy.

    it doesn't work in the coordinate areas of dialog boxes either. Only in the edit window, and probably only in command mode.
  • +1000, I didn't know this and frequently have X+Y values in place of coordinates because I'm lazy.
    With this, I can be even lazier!
  • It's amazing what you can learn when you pick up literature on "down time" (when you're bored.)....


    I've always wondered if Pc-Dmis could solve expressions, in the Edit window on the fly like Solidworks, Mastercam, or most CAD/CAM software. Well, in PcDmis it's not as straight forward as other software BUT it's possible

    ex...1+2 evaluates to 3. In Pcdmis, you would have to hover your mouse over the expression 1+2 to see what it evaluates to.

    Solution: Use the ` (tilde) symbol before an expression (tilde symbol is located below the ESC key on a US qwerty keyboard)

    CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<[COLOR=#FF0000]`1+2[/COLOR],0,0>,<0,0,1>,0.25
    ACTL/<0,0,0>,<0,0,1>,0.25
    TARG/<0,0,0>,<0,0,1>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=4,DEPTH=0.075,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0.06
    AVOIDANCE MOVE=NO,DISTANCE=0.2
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    


    Quickly evaluates to

    CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<[COLOR=#FF0000]3[/COLOR],0,0>,<0,0,1>,0.25
    ACTL/<0,0,0>,<0,0,1>,0.25
    TARG/<0,0,0>,<0,0,1>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=4,DEPTH=0.075,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0.06
    AVOIDANCE MOVE=NO,DISTANCE=0.2
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    


    {"alt":"Click image for larger version Name:\tKeepingExpressionValuesOnly.png Views:\t1 Size:\t15.3 KB ID:\t429697","data-align":"none","data-attachmentid":"429697","data-size":"medium"}

    EDIT: does not work on ASSIGN/ command.


    Very nice find! Thanks!
  • That's not a tilde character, it's a grave accent. The Help has the correct name at least since 2016. And it can be quite tricky to get it to work in a dimension, as you're not allowed to have spaces before the accent, and you don't really see where the number field begins...

    It's a bit interesting that most other computer languages has it the other way around - an constant expression is always evaluated directly, unless quoted with an acute or grave accent...
  • I recognized it wasn't the tilde character, but inferred he was referencing the tilde key, which creates a grave accent unless held down with shift!
    Ah semantics...

    P.S. I love these italics

    P.P.S. I don't believe it works in 2013MR1, and I'm not getting results in 2014.1.
    Doesn't bother me, but interesting to note. Maybe I'm doing it wrong, but it either replaces the text or adds the ` to it.
    Chances are it'sa'me!
  • Actually, on a Swedish keyboard, the key for tilde is different than that for the accents...
  • Nice trick thanks!

    And yeah, this is the tilde ~ and this I think is called a bactick ` (Alternatively referred to as an acute, grave, grave accent, left quote, open quote, or a push)