nested diesel calls in macro

Discussion in 'AutoCAD' started by jwelin, Aug 23, 2004.

  1. jwelin

    jwelin Guest

    Please help me understand why this macro returns unintended results. The macro is intended to display the difference between to distance entries on the status line. The macro is shown below(with line breaks for clarity) and the screen output with menutrace on. The double quotes around the subtract diesel function do not seem to insulate it from the diesel processor as intended. ARe multiple quotation marks not allowed?

    ^C^C
    dist;\\
    setenv;d1;$m=$(getvar,distance);
    dist;\\
    setenv;d2;"$m=$(getvar,distance)";
    setenv;d3;""$m=$(-,$(getenv,d1),$(getenv,d2))"";
    modemacro;"$m=$(getenv,d3)";



    Command:
    Command:
    Command: dist
    Specify first point: Specify second point:
    Distance = 1.000000, Angle in XY Plane = 0.0, Angle from XY Plane = 0.0
    Delta X = 1.000000, Delta Y = 0.000000, Delta Z = 0.000000

    Command: setenv
    Enter variable name: d1
    Value <0.5>: Eval: $(GETVAR, distance)
    ===> 1
    Eval: $(-, $(getenv,d1), $(getenv,d2))
    Eval: $(GETENV, d1)
    ===> 0.5
    Eval: $(GETENV, d2)
    ===> 1
    ===> -0.5
    1


    Command: dist
    Specify first point: Specify second point:
    Distance = 0.500000, Angle in XY Plane = 0.0, Angle from XY Plane = 0.0
    Delta X = 0.500000, Delta Y = 0.000000, Delta Z = 0.000000

    Command: setenv
    Enter variable name: d2
    Value <1>: Eval: $(GETVAR, distance)
    ===> 0.5
    Eval: $(GETENV, d3)
    ===> 0.5
    0.5


    Command: setenv
    Enter variable name: d3
    Value <0.5>: -0.5


    Command: modemacro

    Enter new value for MODEMACRO, or . for none <"0">: 0.5
     
    jwelin, Aug 23, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.