LT macros in AutoCAD

Discussion in 'AutoCAD' started by Mark Gonzales, Jan 26, 2004.

  1. I have a question regarding AutoCAD LT macros in regular AutoCAD.

    To summarize a problem I'm having, I need to be able to set values to the
    Registry in regular AutoCAD using "setenv" as I do in LT (Paul Turvill
    showed me how to do this on 10/03), but then continue with the macro to
    process the value. My examples below use a number value, but I need to do
    the same thing with strings.

    In AutoCAD LT 2000, I use the following macros to calculate a value to the
    current SNAPANG (watch for wrap):

    ====================
    [Add]^C^C_ucs _r md _setenv CalcAngle \_snapang
    $M=$(+,$(angtos,$(getvar,snapang)),$(getenv,calcangle))
    [Subtract]^C^C_ucs _r md _setenv CalcAngle \_snapang
    $M=$(-,$(angtos,$(getvar,snapang)),$(getenv,calcangle))
    [Multiply]^C^C_ucs _r md _setenv CalcAngle \_snapang
    $M=$(*,$(angtos,$(getvar,snapang)),$(getenv,calcangle))
    [Divide]^C^C_ucs _r md _setenv CalcAngle \_snapang
    $M=$(/,$(angtos,$(getvar,snapang)),$(getenv,calcangle))
    ====================

    I have two steps in the LT macros above: a) adding a value b) processing
    the value.

    ====================
    "[Add]^C^C_ucs _r md _setenv CalcAngle \"
    (adds the value [could be a string in other macros])

    "_snapang $M=$(+,$(angtos,$(getvar,snapang)),$(getenv,calcangle))"
    (processes the value [in this case changes the SNAPANG])

    ====================

    In regular AutoCAD 2000 (and thank you again, Paul), I can use...

    ^C^C(setenv "CalcAngle" (getstring "CalcAngle Value: "))

    ....to add the value. But in regular AutoCAD, I can't add to the macro and
    make it process anything.

    For example...

    [Add]^C^C(setenv "CalcAngle" (getstring "CalcAngle Value: "))_snapang
    $M=$(+,$(angtos,$(getvar,snapang)),$(getenv,calcangle))

    ....doesn't work. :(


    Any suggestions?

    Note: There may be an easier way to do this in regular AutoCAD; however,
    resolving this issue while keeping the macros similar to AutoCAD LT is very
    important to me, and may help me solve a few other similar macros (not all
    dealing with numbers).
     
    Mark Gonzales, Jan 26, 2004
    #1
  2. Calification:
    ========

    Please disregard the "_ucs _r md " in my previous examples (an internal
    thing).

    For clarification, I need the regular AutoCAD equivalent to this LT macro
    which adds a value to the Registry and then calculates the current SNAPANG
    using that value:

    [Add]^C^C_setenv CalcAngle \_snapang
    $M=$(+,$(angtos,$(getvar,snapang)),$(getenv,calcangle))
     
    Mark Gonzales, Jan 26, 2004
    #2
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.