Visual LISP, AutoLISP and General Customization

Reply
*Eglauer, Armand
Message 1 of 2 (71 Views)

Changing Elevations of Entities

71 Views, 1 Replies
04-20-2001 06:30 AM
I need a little lisp routine, which I hope is quite simple for all the
knowledge out there ....

I have several hundred entites which have various elevations. I need
something to switch the elevations from positive to negative. For
instance, if a pline has an elevation of 5.23, I want the new
elevation to be -5.23. All of the entities are either points, lines
or plines (regular or lwplines) - I don't believe there are any 3d
plines.

Any assistance is greatly appreciated.

Armand
Distinguished Contributor
Jtrostad
Posts: 138
Registered: ‎04-11-2002
Message 2 of 2 (71 Views)

Re: Changing Elevations of Entities

04-20-2001 08:04 AM in reply to: *Eglauer, Armand
Here's a piece of code to get you started. This mirrors a simple entity (text,blocks without attributes) with one pick.You can probably fix it to flip Z coords with little effort. A word of advice however, You'll get better,& more help if you write the code yourself & ask for help as you get stuck, than if you just ask for finished product.(Stepping off of soap-box) Now here's that starter code I promised:----------------------------------------------------
;Text flip
;mirrors simple entities - no error checking

(defun c:TM (/ textent rt tent)
(setq textent (entsel "\nSelect Text")
tent (entget (car textent)) );gets entity info
(setq v41 (cdr (assoc 41 tent)));finds x scale
(princ v41)
(setq rt (- V41));flips x-scale value

(setq tent
(subst (cons 41 rt)
(assoc 41 tent)
tent)
);replaces old val w/flipped val
(entmod tent)
(princ);stays quiet
)

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