LISP HELP, 95% WORKS

Discussion in 'AutoCAD' started by chetz, Mar 31, 2005.

  1. chetz

    chetz Guest

    I would like to change the final arc drawn to a radial linetype, color 4 while leaving the arrow head intact as bylayer color and linetype.

    the line with "ENTLAST" doesnt work. It doesnt grab the last drawn entity so the arc is remaining as current linetype.

    (defun c:ALEAD()
    (prompt "\n Are the DIMSCALE and DIMASZ variables set? ")
    (setq SP (getpoint "\n Arrow start point"))
    (setq ANGP (getpoint SP "\n Arrow angle"))
    (setq ARRANG (angle SP ANGP))
    (if (= 0.0 (getvar "DIMASZ"))
    (setq LENG 1.0)
    (setq LENG (* 1.3 (getvar "DIMASZ")))
    )
    (setq EP (polar SP arrang (* LENG (getvar "DIMSCALE"))))
    (setq PLENG (* 0.20 LENG (getvar "DIMSCALE")))
    (command ".PLINE" SP "W" "0.0" PLENG EP "W" "0.0" "0.0" "")
    (command ".PLINE" ep "w" "0.0" "0.0" "ARC")
    (COMMAND ".CHANGE" (ENTLAST) "" "P" "LT" "radial" "P" "C" "4")
    (COMMAND "")
    )
     
    chetz, Mar 31, 2005
    #1
  2. Looks like you're trying to give it a Change command at a point where it's
    not going to have the Command prompt there, but rather Pline's prompt for
    options on an arc segment. If you always do the arc the same way, put in
    enough "" entries for the points you'd give it, or put in the "E" or "D" or
    something, and finish the Pline command before you get to the Change
    command. If you might do the arc in different ways, you probably need a
    (while) thing going on, with a check against the CMDACTIVE system variable,
    so it can tell when you're done with Pline before going on to the Change
    part.

    Better yet, if the arc is only a single Pline arc segment, forget using
    Pline for it -- just use a garden-variety arc, and you won't have to define
    the width or anything.
     
    Kent Cooper, AIA, Mar 31, 2005
    #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.