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
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?
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.