TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Water Bear on March 20, 2004, 09:35:51 AM
-
I need a little help with attributes. I can't get this to stop for input at the "insert"..needs user to enter a response to 3 attributes...but it just breezes by!
(defun add ()
(setq grp (ssadd (entlast) grp))
)
(defun vav_label (/ pt1 pt2 grp)
(init)
(setq pt1 (getpoint "\nPick a point ON the VAV..")
pt2 (getpoint "\nSelect a location for the text:" pt1)
)
(command "layer" "m" "SM-Equipment Details"
"c" "1" "" "lw"
".35" "" ""
)
(command ".pline" pt1 "w" 0 10 pt2 "")
(setq grp (ssget "L"))
(command ".circle" pt2 22)
(add)
(command "layer" "m" "SM-Equipment" "c" "1" "" "lw" ".80" "" "")
(command "circle" pt2 25)
(add)
(setvar "osmode" 1)
(command "trim" "L" "" pt2 "")
(command "layer" "m" "SM-Equipment Text" "c"
"1" "" "lw" ".35" ""
""
)
(command "insert" "VAV TAG" pt2 "1" "1" "0")<===has 3 atributes which need input
(command pause pause pause)
(add)
(command "-group" "c" "*" "" grp "")
(reset)
(princ)
)
:roll:
I know that the cause is the command with the pauses..but if I remove that line, I get an error because the next line is trying to add it to a group BEFORE the promts are answered! :shock: :yikes:
-
Have you tried this ???
(command "insert" "VAV TAG" pt2 "1" "1" "0" pause pause pause )<===has 3 atributes which need input
-
This may also work:
(command "insert" "VAV TAG" pt2 "1" "1" "0")
(while (> (getvar "CMDACTIVE") 0) (command pause))
or this
(command "insert" "VAV TAG" pt2 "1" "1" "0")
(while (= (logand (getvar "CMDACTIVE") 8) 1) (command pause) )
-
Thanks for the help guys...but I tried ALL three variations, and it still does the same thing! :?
-
:)
(setvar "attdia" 1)
(setvar "attreq" 1)
(initdia)
(command "-insert" "My Block" pt2 "1" "1" "0" pause )
CAB
-
do the attributes have the "preset" tag marked?
-
@CAB That last one works..it allows me to respond to the promts via PDB, but if I do anything after that (pan,zoom etc) it generates an error and undoes all (as req'd by error trap). Perhaps it's something in the way I'm "grouping" the items?
-
Try it without the pause. I think that is where the problem is.
(setvar "attdia" 1)
(setvar "attreq" 1)
(initdia)
(command "-insert" "My Block" pt2 "1" "1" "0" )
-
That wuz it! Thanx :D :dood: