Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
New Member
hansx
Posts: 1
Registered: ‎03-25-2009
Message 1 of 2 (61 Views)

looking for a lispfile that will move some attributes

61 Views, 1 Replies
03-25-2009 01:40 PM
Hi,

I'm looking for a lispfile that will move some attributes to a specific height and centre them on the insertionpoint of the block

for example, I will select the block, and 3 attributes with the TAG DESCRIPTION1, DESCRIPRTION2 and DESCRIPTION3 must be centered by the insertionpoint of the original block and after that they must be moved to for eample the height Y=250 for DESCRIPTION1, the height Y=245 for DESCRIPTION2 and the height Y=240 for DESCRIPTION3 for the X value I must take the X value from the block what is selected.

can somone help me with this?

Thanks
Active Contributor
st0neface
Posts: 35
Registered: ‎03-17-2009
Message 2 of 2 (61 Views)

Re: looking for a lispfile that will move some attributes

03-26-2009 03:17 AM in reply to: hansx
without any error checking, but should you turn into the right direction:



(setq en (car (entsel)))
(setq p1 (cdr (assoc 10 (entget en))))

(setq y1 (car p1)
x1 (cadr p1)
y2 250.0 ;or relative to block insertion: y2 (+ y1 250)
y3 245.0
y4 240.0
at1 (entnext en)
at2 (entnext at1)
at3 (entnext at2)
atl1 (entget at1)
atl2 (entget at2)
atl3 (entget at3)
)

(setq atl1 (subst (cons 10 (list y2 x1 0.0))(assoc 10 atl1) atl1)
atl2 (subst (cons 10 (list y3 x1 0.0))(assoc 10 atl2) atl2)
atl3 (subst (cons 10 (list y4 x1 0.0))(assoc 10 atl3) atl3)
)
(entmod atl1)
(entmod atl2)
(entmod atl3)

(princ)

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community