Hi Alls,
I got problem, and my brain got locked to solve this problem, how to add list funtion or quote at a variable.
(xxx yyy) to '(xxx yyy)
This code is function to put number every vertex of polyline
; nvop is stand for Numbering Vertex Object Polyline
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 11 July 2007
; Program no.: 0615/07/2007
; Edit by :
; ***********UNDER CONSTRUCTION*************
(defun massoc (key alist / x nlist) ; Jaysen Long
(foreach x alist
(if
(eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)
(defun c:nvop (/ cnt etyp len loc lst pre ss sse str th ts)
(if
(setq ss (car (entsel "\nPick an object polyline")))
(progn
(setq sse (entget ss))
(setq etyp (cdr (assoc 0 sse)))
(if
(= etyp "LWPOLYLINE")
(progn
(setq lst (massoc 10 sse))
(setq len (length lst))
(setq pre (getint "\nEnter number as prefix<0>: "))
(if (= pre nil)(setq pre 0))
(setq cnt 0)
(setq ts (getvar "textsize"))
(if
(or (> ts 1)(< ts 1))
(setq th 1)
) ; if
(repeat
len
(setq loc (nth cnt lst))
(setq str (strcat (itoa pre)(itoa (1+ cnt))))
(command "_text" loc th "" str)
; still get trouble in loc variable, from (xx yyy) it shouls '(xx yy)
) ; repeat
) ; progn
(alert "\nInvalid object line, it's not LWPOLYLINE")
) ; if
) ; progn
(alert "\nInvalid selected object, please try again")
) ; if
(princ)
) ; defun