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.
Parents
  • 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!
Reply
  • 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!
Children
No Data