Author Topic: Breezing by...  (Read 3159 times)

0 Members and 1 Guest are viewing this topic.

Water Bear

  • Guest
Breezing by...
« 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:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Breezing by...
« Reply #1 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
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

CAB

  • Global Moderator
  • Seagull
  • Posts: 10376
Breezing by...
« Reply #2 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) )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Water Bear

  • Guest
Breezing by...
« Reply #3 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! :?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10376
Breezing by...
« Reply #4 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
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Breezing by...
« Reply #5 on: March 21, 2004, 12:23:37 PM »
do the attributes have the "preset" tag marked?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Water Bear

  • Guest
Breezing by...
« Reply #6 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?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10376
Breezing by...
« Reply #7 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" )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Water Bear

  • Guest
Breezing by...
« Reply #8 on: March 22, 2004, 03:12:09 PM »
That wuz it! Thanx :D  :dood: