How to create a lightweight polyline using existing lines and arcs

How to create a lightweight polyline using existing lines and arcs

Anonymous
Not applicable
3,114 Views
6 Replies
Message 1 of 7

How to create a lightweight polyline using existing lines and arcs

Anonymous
Not applicable

Hi all,

 

Just wondering if anyone out there is able to help me out with using VB.NET to create a new polyline out of existing lines and arcs? I am converting existing VBA code into VB.NET, developing in AutoCAD 2010 using VS Professional and I just stumbled into this road block.

 

Without using programming code, this task can be accomplished via AutoCAD command by typing the PE command, selecting the JOIN option and then selecting any lines or arcs which should be combined to form a polyline.

 

Using programming code, however, I am quite stumped on this task. I have been able to successfully create the lines and arcs which should form the polyline, and they are all connected as well so they would form a connected polyline; I simply do not know how to proceed from here.

 

Any guidlelines or suggestions?

 

Thanks in advance!

0 Likes
Accepted solutions (1)
3,115 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

Check out TheSwamp. Search GeometryExtensions. There is a bunch of good stuff there. If memory serves it is in C# but you can use one of the online translators. Sorry that I do not remeber the author(s)...if someone does please help me out and post their names.

r,

dennis

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks Dennis

0 Likes
Message 4 of 7

_gile
Consultant
Consultant

Hi,

 

You can translate GeometryExtensions (almost the PolylineSegment and PolylineSegmentCollection classes) from C# to VB if you want, but you can also simply reference the DLL (setting Copy Local to True) and use the methods provided by these classes (look at the MJOIN command sample in this reply).

 

PS: download the Doc.zip file too it contains the library documentation (chm).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 7

Anonymous
Not applicable

I am still lost on this topic... I tried, but was unable to find a GeometryExtensions reference to include in my VB.NET project reference. However, I did some searching on this forum, and I found the topic "Convert Arcs to Polylines" where an arc was successfully converted to a polyline.

 

This is close to what I need to accomplish, except that, instead of just one arc, I need to convert 3 lines and and arc into a polyline. Is there a way to programmatically join these entities so that they can become one single representation of a polyline instead of just 3 lines and an arc?

 

Please help!!!

0 Likes
Message 6 of 7

_gile
Consultant
Consultant

Did you download GeometryExtensions(1.4).zip from TheSwamp (using the above link) ?

The zip file contains GeometryExtensions_18.dll and GeometryExtensions_19.dll. You have to reference the first one for A2010-2012 projects and the second for A3013 and later projects.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 7 of 7

Anonymous
Not applicable
Accepted solution

Thanks, just accessed the download link...

0 Likes