
Originally Posted by
ldgodsey
I'm in need of some help.
I have a block that I need auto-numbering for.
I've tried several different routines even one that I
wrote and can't seem to get it to do want I want it to.
It's a circle divided in two the upper number will be the mile
the lower number will be the pole number.
Can anyone help me please.
Lloyd.Godsey@aps.com
This routine just needs a block called "pole" with 2 attributes, mile and pole, defined in that order. It uses 2 global variables so your numbering will pick up where you left off if you exit the command. If you enter a keyword, "M" or "P", you can adjust the current number. There is no error checking included.
Code:
(defun c:PlacePole ( / pnt )
(setq PlacePole$mile 1
PlacePole$pole 1
)
(while (progn
(initget "Mile Pole")
(setq pnt
(getpoint
(strcat "\nMile "
(itoa PlacePole$mile) "/Pole: "
(itoa PlacePole$pole) ":"))
)
)
(cond
((= pnt "Mile")
(setq PlacePole$mile (getint "\nEnter new mile number: "))
(setq PlacePole$pole 1)
)
((= pnt "Pole")
(setq PlacePole$pole (getint "\nEnter new pole number: "))
)
((= (type pnt) 'LIST)
(setvar "ATTDIA" 0)
(command ".INSERT" "POLE" pnt 40 "" ""
(itoa PlacePole$mile) (itoa PlacePole$pole))
(setvar "ATTDIA" 1)
(setq PlacePole$pole (1+ PlacePole$pole))
)
)
)
)
- Frank