TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Water Bear on March 20, 2004, 09:35:51 AM

Title: Breezing by...
Post 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!
Code: [Select]
(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:
Title: Breezing by...
Post by: Keith™ on March 20, 2004, 11:09:23 PM
Have you tried this ???
Code: [Select]
(command "insert" "VAV TAG" pt2 "1" "1" "0" pause pause pause )<===has 3 atributes which need input
Title: Breezing by...
Post by: CAB on March 20, 2004, 11:40:47 PM
This may also work:

Code: [Select]
(command "insert" "VAV TAG" pt2 "1" "1" "0")
(while (> (getvar "CMDACTIVE") 0)  (command pause))


or this

Code: [Select]
(command "insert" "VAV TAG" pt2 "1" "1" "0")
(while (= (logand (getvar "CMDACTIVE") 8) 1) (command pause) )
Title: Breezing by...
Post by: Water Bear on March 21, 2004, 09:13:27 AM
Thanks for the help guys...but I tried ALL three variations, and it still does the same thing! :?
Title: Breezing by...
Post by: CAB on March 21, 2004, 11:32:38 AM
:)

Code: [Select]
 (setvar "attdia" 1)
  (setvar "attreq" 1)
  (initdia)
  (command "-insert" "My Block" pt2 "1" "1" "0" pause )


CAB
Title: Breezing by...
Post by: Keith™ on March 21, 2004, 12:23:37 PM
do the attributes have the "preset" tag marked?
Title: Breezing by...
Post by: Water Bear on March 21, 2004, 12:41:59 PM
@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?
Title: Breezing by...
Post by: CAB on March 22, 2004, 02:38:42 PM
Try it without the pause. I think that is where the problem is.

Code: [Select]
  (setvar "attdia" 1)
  (setvar "attreq" 1)
  (initdia)
  (command "-insert" "My Block" pt2 "1" "1" "0" )
Title: Breezing by...
Post by: Water Bear on March 22, 2004, 03:12:09 PM
That wuz it! Thanx :D  :dood: