PDA

View Full Version : Insert a block with attribute value from selected polyline



Raúl Niembro
2015-03-19, 11:57 PM
This is a small routine to insert a block with attributes. the idea is to select a polyline with elevation, then insert the block, the elevation of the polyline is the value for the block attribute. I need help to make this routine work. i can select the polyline but then the routine crashes....



(defun eplat (/ ITEM1 ITEM2 xval2 yval2)
(setq precision (getvar "precisa"))
(setvar "precisa" 2)
(setq ITEM1 (getpoint "\nSeleccione Plataforma: "))
(setq ztext (rtos (caddr ITEM1)))
(setq ITEM2 (getpoint "\nIndique Ubicación: "))
(setq xval2 (car ITEM2))
(setq yval2 (cadr ITEM2))
(setq txtloc (list xval2 yval2))
(setvar ATTREQ 1)
(setvar ATTDIA 0)
(command "-insert" "eplat" txtloc "1" "1" "0" ztext)
(setvar ATTDIA 1)
(setvar "precisa" precision)
)