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

pline start and end angles

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
markruys2
386 Views, 4 Replies

pline start and end angles

is there a function to obtain the start angle and end angle of a pline,i know arcs do

thanks

4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: markruys2


@markruys2 wrote:

is there a function to obtain the start angle and end angle of a pline....


If 'ent' is the entity name of the Polyline, and you have (vl-load-com) loaded:

 

(angle '(0 0 0) (vlax-curve-getFirstDeriv ent (vlax-curve-getStartParam ent)))

(angle '(0 0 0) (vlax-curve-getFirstDeriv ent (vlax-curve-getEndParam ent)))

 

Returned values will be in radians.

Kent Cooper, AIA
Message 3 of 5
dbroad
in reply to: Kent1Cooper

Kent,

 

Are you sure about the ename?  I believe it is the vla-object:

 

;;for end angle (in radians)

(setq obj (vlax-ename->vla-object(car(entsel))))
(angle '(0 0 0) (vlax-curve-getFirstDeriv obj (vlax-curve-getEndParam obj)))

Architect, Registered NC, VA, SC, & GA.
Message 4 of 5
Kent1Cooper
in reply to: dbroad


@dbroad3 wrote:

... 

Are you sure about the ename?  I believe it is the vla-object:

....


Doug:

 

This question comes up now and then.  The (vlax-curve-...) functions at least, though certainly not all (vla...) functions, work with entity names just as well as with VLA objects.  It spares the need to make the conversion, unless that is also needed to do other things with the same entity, that do require it.  I have loads of routines that do these kinds of things using entity names, and they all work fine.

Kent Cooper, AIA
Message 5 of 5
dbroad
in reply to: Kent1Cooper

Thanks.  

Architect, Registered NC, VA, SC, & GA.

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

Post to forums  

Autodesk Design & Make Report

”Boost