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

subst in polyline

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
743 Views, 2 Replies

subst in polyline

Hi

 

I would like to know how I would use the (subst) function with a polyline entity with regards to its vertices? Let's say I wanted to move all the vertices to the right, how would I isolate each vertex and move it, since all vertices have the DXF code 10?

 

Thanks

 

Derryck

2 REPLIES 2
Message 2 of 3
Kent1Cooper
in reply to: Anonymous

Sounds like a job for MOVE.

 

But if you're trying this just as an exercise, it should be possible by extracting all the vertex locations into a list of points, something like [untested]:

 

(setq vertexlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ThePolylineEntityName))))

 

then stepping through that list, replacing the X coordinates with increased values, then (appending) all of those point lists together into one list of all coordinates, and imposing that as the 'Coordinates property on the Polyline as a VLA object.  Do you know enough to implement those steps?

Kent Cooper, AIA
Message 3 of 3
john.uhden
in reply to: Kent1Cooper

The OP may not have been speaking of just LWPolylines.  The DXF code 10 approach won't work with heavies or 3Ds.

I like to grab the vla-object's coordinates (a flat list) and group them into a list of 2D or 3D points, make whatever changes, additions, or deletions and write them back to the coordinates property.  I read somewhere once that you're supposed to be not able to do that, but it's always worked for me.  The toughest part for me is always rematching the bulges.

John F. Uhden

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report