Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need lisp to get y coordinate as attribut 1

Status
Not open for further replies.

dopa72

Technical User
Feb 11, 2004
3
DE
i have a block with attribute and must set in the y coordinate. the fastes way i thing is get a lisp witch use the coordinates. who can help me?
 
If the block has only one attribute, the following should work for one block at a time:

(princ "\nType LY to start ")
(defun c:ly ()
(setq BlockEnt (car (entsel "\nSelect block to label: ")))
(setq ycoord (cadr (cdr (assoc 10 (entget BlockEnt)))))
(setq ytxt (rtos ycoord))
(setq AttEnt (entnext BlockEnt))
(setq AttData (entget AttEnt))
(Setq AttTxt (assoc 1 AttData))
(setq NewData (subst (cons 1 ytxt) AttTxt AttData))
(entmod NewData)
(entupd BlockEnt)
(princ)
)
 
i have create this and loadet and when i typ ly then comes "seleckt block to label" and when i pick to block its say "; error: bad argument type: lentityp nil"
 
sorry, it works fantastic !!! great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top