<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic element to lwpolylines in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637120#M34593</link>
    <description>Please, &lt;BR /&gt;
VBA  autocad 2004&lt;BR /&gt;
I have in my "SelectionSet" a group of line,arcs, lwpolylines,&lt;BR /&gt;
how can I obtein from then only one lwpolyline  with VBA code?&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help me?&lt;BR /&gt;
thankyou</description>
    <pubDate>Mon, 08 May 2006 17:19:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-05-08T17:19:49Z</dc:date>
    <item>
      <title>element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637120#M34593</link>
      <description>Please, &lt;BR /&gt;
VBA  autocad 2004&lt;BR /&gt;
I have in my "SelectionSet" a group of line,arcs, lwpolylines,&lt;BR /&gt;
how can I obtein from then only one lwpolyline  with VBA code?&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help me?&lt;BR /&gt;
thankyou</description>
      <pubDate>Mon, 08 May 2006 17:19:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637120#M34593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-08T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637121#M34594</link>
      <description>this is my first ever reply to a question as I have been learning, so I hope &lt;BR /&gt;
it works, and I am sure there is probably a much easier way to do it&lt;BR /&gt;
&lt;BR /&gt;
After the selection set has been created, iterate through the entities.&lt;BR /&gt;
&lt;BR /&gt;
Dim oEntity as AcadEntity&lt;BR /&gt;
&lt;BR /&gt;
For Each oEntity in SelectionSet&lt;BR /&gt;
    If TypeOf oEntity Is AcadLWPolyline Then&lt;BR /&gt;
        &lt;CODE&gt;&lt;BR /&gt;
    End If&lt;BR /&gt;
Next oEntity&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps&lt;BR /&gt;
&lt;BR /&gt;
&lt;JANBO222&gt; wrote in message news:5167419@discussion.autodesk.com...&lt;BR /&gt;
Please,&lt;BR /&gt;
VBA  autocad 2004&lt;BR /&gt;
I have in my "SelectionSet" a group of line,arcs, lwpolylines,&lt;BR /&gt;
how can I obtein from then only one lwpolyline  with VBA code?&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help me?&lt;BR /&gt;
thankyou&lt;/JANBO222&gt;&lt;/CODE&gt;</description>
      <pubDate>Tue, 09 May 2006 03:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637121#M34594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-09T03:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637122#M34595</link>
      <description>Thanks for the answer BrentB,&lt;BR /&gt;
 but as I can transform linens in lwpolyline&lt;BR /&gt;
 and arc in lwpolyline &lt;BR /&gt;
and therefore to assemble the all in one single lwpolyline?</description>
      <pubDate>Wed, 10 May 2006 01:27:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637122#M34595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-10T01:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637123#M34596</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
It can be done, but you will need to find the start and end points of each &lt;BR /&gt;
of the objects you select and then match the various objects so that you can &lt;BR /&gt;
find which joins to which.&lt;BR /&gt;
&lt;BR /&gt;
You can then create an array of coordinates of the joining points from which &lt;BR /&gt;
to define the new polyline.  You also need to keep track of which items are &lt;BR /&gt;
arcs, so that you can add the bulges to the polyline after you have created &lt;BR /&gt;
it.&lt;BR /&gt;
&lt;BR /&gt;
You also need to decide how you will treat gaps if you find two objects &lt;BR /&gt;
which nearly meet, but not quite.&lt;BR /&gt;
&lt;BR /&gt;
You also need to decide what you will do if three or more objects meet as a &lt;BR /&gt;
point&lt;BR /&gt;
&lt;BR /&gt;
You also need to decide if you wish to delete - or keep the original &lt;BR /&gt;
objects.  While coding,  I'd keep them for comparison purposes.  When it all &lt;BR /&gt;
works, it up to you what you do with them.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JANBO222&gt; wrote in message news:5169442@discussion.autodesk.com...&lt;BR /&gt;
Thanks for the answer BrentB,&lt;BR /&gt;
 but as I can transform linens in lwpolyline&lt;BR /&gt;
 and arc in lwpolyline&lt;BR /&gt;
and therefore to assemble the all in one single lwpolyline?&lt;/JANBO222&gt;</description>
      <pubDate>Wed, 10 May 2006 03:34:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637123#M34596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-10T03:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637124#M34597</link>
      <description>Thanks thousands of the Laurie answer, &lt;BR /&gt;
are what I feared, but,&lt;BR /&gt;
 - if the objects in the selection list are already order to you,&lt;BR /&gt;
 - if they do not have discontinuity, &lt;BR /&gt;
 - if they do not concur more in the same point than two objects,&lt;BR /&gt;
 the possibility does not exist to adopt a method similar to those&lt;BR /&gt;
       "Linens to LWPolyLine"&lt;BR /&gt;
        Posted by: Nadotti, Paolo&lt;BR /&gt;
        Given: Jan/03/02 - 06:21 (GMT)&lt;BR /&gt;
   transforming then the SPLINE in LWPOLYLINE? &lt;BR /&gt;
&lt;BR /&gt;
Gianni</description>
      <pubDate>Wed, 10 May 2006 22:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637124#M34597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-10T22:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: element to lwpolylines</title>
      <link>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637125#M34598</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
If that is the case&lt;BR /&gt;
 AND the lines / arcs etc are drawn in the correct direction so you don't &lt;BR /&gt;
need to check that, then&lt;BR /&gt;
&lt;BR /&gt;
You can have code like this pseudo code:&lt;BR /&gt;
dim pCoords() as double&lt;BR /&gt;
redim pCoords(0 to SelectionSet.Count * 4 -1)&lt;BR /&gt;
i = 0&lt;BR /&gt;
for each object in SelectionSet&lt;BR /&gt;
 if typeof object is LINE then&lt;BR /&gt;
    set oLine = object&lt;BR /&gt;
    vPt = oLine.start&lt;BR /&gt;
    pCoords (i) = vP(0)&lt;BR /&gt;
    pCoords (i + 1) = vP(1)&lt;BR /&gt;
   i = i + 2&lt;BR /&gt;
    vPt = oLine.end&lt;BR /&gt;
    pCoords (i) = vP(0)&lt;BR /&gt;
    pCoords (i + 1) = vP(1)&lt;BR /&gt;
   i = i + 2&lt;BR /&gt;
     elseif typeof object is ARC then&lt;BR /&gt;
    set oArc = object&lt;BR /&gt;
    vPt = oArc .start&lt;BR /&gt;
    pCoords (i) = vP(0)&lt;BR /&gt;
    pCoords (i + 1) = vP(1)&lt;BR /&gt;
   i = i + 2&lt;BR /&gt;
    vPt = oArc .end&lt;BR /&gt;
    pCoords (i) = vP(0)&lt;BR /&gt;
    pCoords (i + 1) = vP(1)&lt;BR /&gt;
   i = i + 2&lt;BR /&gt;
    elseif typeof object is LWPolyline&lt;BR /&gt;
  ......&lt;BR /&gt;
end if&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
&lt;BR /&gt;
&lt;JANBO222&gt; wrote in message news:5170904@discussion.autodesk.com...&lt;BR /&gt;
Thanks thousands of the Laurie answer,&lt;BR /&gt;
are what I feared, but,&lt;BR /&gt;
 - if the objects in the selection list are already order to you,&lt;BR /&gt;
 - if they do not have discontinuity,&lt;BR /&gt;
 - if they do not concur more in the same point than two objects,&lt;BR /&gt;
 the possibility does not exist to adopt a method similar to those&lt;BR /&gt;
       "Linens to LWPolyLine"&lt;BR /&gt;
        Posted by: Nadotti, Paolo&lt;BR /&gt;
        Given: Jan/03/02 - 06:21 (GMT)&lt;BR /&gt;
   transforming then the SPLINE in LWPOLYLINE?&lt;BR /&gt;
&lt;BR /&gt;
Gianni&lt;/JANBO222&gt;</description>
      <pubDate>Thu, 11 May 2006 02:26:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/element-to-lwpolylines/m-p/1637125#M34598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-11T02:26:30Z</dc:date>
    </item>
  </channel>
</rss>

