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

How to change the extrusion direction

4 REPLIES 4
Reply
Message 1 of 5
petd
3224 Views, 4 Replies

How to change the extrusion direction

Hi,

I like to change the Z= propertie form lines and arcs (that are from a exploded solids from

a 3d solid) extrusion direction relative to UCS:

X= 0.0000 Y= 0.0000 Z= -1.0000



Propertie box: Geometry: Normal Z= -1.0000



Explanation in the autocad help:

Reports the X,Y,Z values of the normal direction vector relative to the WCS
This property specifies a vector, not a location in space



The Z-value should be 1



Peter D
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: petd

one way...

(DEFUN CHANGEZ()
(SETQ ENT(CAR(ENTSEL"\nPick"))
elst(entget ent)
extr(cdr(assoc 210 elst)) ; get the existing extrusion direction
)
;modify the z as needed
;just for example I made the z -1 since the line I selected started out with
1
(setq newextr(list (car extr)(cadr extr) -1))
;you would reverse that for your needs or whatever other adjustments you
wanted to do

;rewrite the entity list with new extrusion direction
(setq elst
(subst (cons 210 newextr)
(assoc 210 elst)
Elst
)
)
;update database
(entmod elst)
)

hth
Mark

"petd" wrote in message news:f16e2e1.-1@WebX.maYIadrTaRb...
> Hi,
> I like to change the Z= propertie form lines and arcs (that are from a
exploded solids from
> a 3d solid) extrusion direction relative to UCS:
> X= 0.0000 Y= 0.0000 Z= -1.0000
>
> Propertie box: Geometry: Normal Z= -1.0000
>
> Explanation in the autocad help:
> Reports the X,Y,Z values of the normal direction vector relative to the
WCS
> This property specifies a vector, not a location in space
>
> The Z-value should be 1
>
> Peter D
>
>
Message 3 of 5
Anonymous
in reply to: petd

or possibly you might want to do...

(setq newextr(list (car extr)(cadr extr) (abs(caddr extr))))

in lieu of the line below
> (setq newextr(list (car extr)(cadr extr) -1))


"Mark Propst" wrote in message
news:A3FC2498E496F8883C3922A075A9BD0F@in.WebX.maYIadrTaRb...
> one way...
>
Message 4 of 5
petd
in reply to: petd

Mark,

You already helped me a lot, but i still have a little problem with the coördinates, after running the routine the changed entities goes to other coordinates, i tried to resolve the problem with trans the coördinates but this wont help (note: i made the drawing in world coördinates).


Peter D.
Message 5 of 5
craig.snyder
in reply to: Anonymous

Mark, I realize this is an old issue but hopefully you won't mind revisiting it.  Assume a hole located at 2,3 with a direction vector of 0,0,-1.  When I run your suggested program the direction vector is changed to 0,0,1 but in addition, the hole is spun around the y axis 180 degrees and now is located at -2,3.  Any suggestions as to how to keep the hole at the original location?

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

Post to forums  

Autodesk Design & Make Report

”Boost