How can I get all entities in lwpolyline

How can I get all entities in lwpolyline

Anonymous
Not applicable
562 Views
5 Replies
Message 1 of 6

How can I get all entities in lwpolyline

Anonymous
Not applicable


Hi,eveyr one,I'm good at VBA,but I can't resolve this problem,I uploaded a picture,the left I draw a lwpolyline with white color,the right is the result.In VBA,how can I do?





Thanks for advices

Jiandan Luo

0 Likes
563 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
>>How can I get all entities in lwpolyline

There arent any "entities" in a polyline - you wont find a list of lines and arcs ... what you will find is a list of Coordinates.
If you check the help under the coordinates function, there is some sample code that will get you started.

A couple of things that you WONT see in the example for the help file:

1) You have to check the polyline for the .Closed property. If the polyline is closed, then acad automatically draws a line from the last coordinate, to the first coordinate. if your polyline is closed, and it looks like it is, then you'd have to account for the 'missing' 4th coordinate.

2) if the polyline has arcs in it, you will have to figure out the radii by using the .GetBulge method. Its about as intuitive as using radians instead of degrees, but its just something you have to get used to.

3) The polyline object can have different widths along each segment: you have to check with the .GetWidth method... your polyline looks to have width to it.

4) and lastly, there are different types of polylines - three, at my last count, and depending on your version of the drawing .... there is a 'regular' polyline, a lighweight polyline, and a 3d polyline. Each of these types has slightly different features to them.
0 Likes
Message 3 of 6

Anonymous
Not applicable
rocheey,thanks a lot

but I believe the simplest,the best,so I think this way isn't the best.

The following is my opinion

1 Create the selectionset use SelectByPolygon

2 Copy and move

3 Use Extrim clip entities which intersect with polyline
0 Likes
Message 4 of 6

Anonymous
Not applicable
>>How can I get all entities in lwpolyline

>>1 Create the selectionset use SelectByPolygon
>>2 Copy and move
>>3 Use Extrim clip entities which intersect with polyline

and how does that answer your question? about getting all the entities in a polyline ?
0 Likes
Message 5 of 6

Anonymous
Not applicable
maybe the terminology is a little inaccurate, but the jpg the OP posted explains what they want to do
0 Likes
Message 6 of 6

Anonymous
Not applicable
Hi,rocheey,the object is lwpolyline or polyline according to the object which offset.Their difference is coordinates,but (x,y) can convert to (x,y,z) which z=0,so I think the crux is not the type of this object.

Thank you for the same

Jiandan Luo
0 Likes