Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Elevations of Entities

1 REPLY 1
Reply
Message 1 of 2
Anonymous
167 Views, 1 Reply

Changing Elevations of Entities

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
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

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
)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost