<?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 Re: intersectwith between polyline and lines problem in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4649011#M46806</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;start command &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;_UNITS&lt;/FONT&gt; and set the number of decimal placed for "&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Length&lt;/FONT&gt;" ==&amp;gt; "&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Precision&lt;/FONT&gt;" to the maximum.&lt;/P&gt;
&lt;P&gt;Then select the lowest red line and look to the Z-values for start- and endpoint.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/71631i06835593EBA35222/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2013-11-25 11-10-14.png" title="2013-11-25 11-10-14.png" align="middle" /&gt;&lt;/P&gt;
&lt;P&gt;Having different Z-values ends most of the time in problems. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2013 10:12:23 GMT</pubDate>
    <dc:creator>Alfred.NESWADBA</dc:creator>
    <dc:date>2013-11-25T10:12:23Z</dc:date>
    <item>
      <title>intersectwith between polyline and lines problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4648717#M46805</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem while executing intersectwith between polylines and lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the polyline execute intersectwith method referencing a line object with expandboth parameter value&lt;/P&gt;&lt;P&gt;but sometimes , the intersection is not found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when using expandthis or expandargument values, I have no&amp;nbsp;problems&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'am using VS2012 express and Autocad 2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the attached project containt :&lt;/P&gt;&lt;P&gt;&amp;nbsp; an image (result;png) showing my result&lt;/P&gt;&lt;P&gt;&amp;nbsp; a dwg file (dessin3.dwg) , it is my test file&lt;/P&gt;&lt;P&gt;&amp;nbsp; the source code for testing , (test" command)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;it find all polylines and all lines in the drawing , compute the intersections between each couple and draw a dbpoint on each&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you help me ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luc&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 08:20:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4648717#M46805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-25T08:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: intersectwith between polyline and lines problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4649011#M46806</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;start command &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;_UNITS&lt;/FONT&gt; and set the number of decimal placed for "&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Length&lt;/FONT&gt;" ==&amp;gt; "&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Precision&lt;/FONT&gt;" to the maximum.&lt;/P&gt;
&lt;P&gt;Then select the lowest red line and look to the Z-values for start- and endpoint.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/71631i06835593EBA35222/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2013-11-25 11-10-14.png" title="2013-11-25 11-10-14.png" align="middle" /&gt;&lt;/P&gt;
&lt;P&gt;Having different Z-values ends most of the time in problems. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 10:12:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4649011#M46806</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-11-25T10:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: intersectwith between polyline and lines problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4649403#M46807</link>
      <description>&lt;P&gt;Luc,&lt;/P&gt;
&lt;P&gt;Try this code instead&lt;/P&gt;
&lt;PRE&gt;        &amp;lt;CommandMethod("test3")&amp;gt; _
        Public Shared Sub test3()
            Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim Ed As Editor = doc.Editor

            Dim FilterList(0) As TypedValue
            FilterList.SetValue(New TypedValue(DxfCode.Start, "*POLYLINE"), 0)
            Dim Filtre As New SelectionFilter(FilterList)
            Dim Sel As PromptSelectionResult = Ed.SelectAll(Filtre)
            Dim IdsPoly() As ObjectId = Sel.Value.GetObjectIds

            Dim FilterList2(0) As TypedValue
            FilterList2.SetValue(New TypedValue(DxfCode.Start, "LINE"), 0)
            Dim Filtre2 As New SelectionFilter(FilterList2)
            Sel = Ed.SelectAll(Filtre2)
            Dim IdsLine() As ObjectId = Sel.Value.GetObjectIds


            Using TR As Transaction = db.TransactionManager.StartTransaction
                Dim ModelSpaceId As ObjectId = SymbolUtilityServices.GetBlockModelSpaceId(db)
                Dim btr As BlockTableRecord = TR.GetObject(ModelSpaceId, OpenMode.ForWrite)

                For P = LBound(IdsPoly) To UBound(IdsPoly)
                    Dim Idpoly As ObjectId = IdsPoly(P)
                    Dim Poly As Polyline = TR.GetObject(Idpoly, OpenMode.ForRead)
                    For L = LBound(IdsLine) To UBound(IdsLine)
                        Dim id As ObjectId = IdsLine(L)
                        Dim pts As New Point3dCollection
                        Dim Lig As Autodesk.AutoCAD.DatabaseServices.Line = CType(TR.GetObject(id, OpenMode.ForRead), Autodesk.AutoCAD.DatabaseServices.Line)
                        'assuming just extend lines to get intersection
                        Lig.IntersectWith(Poly, Intersect.ExtendThis, pts, IntPtr.Zero, IntPtr.Zero)
                        For Each Pt As Point3d In pts
                            'original code commented :
                            'Dim d As New DBPoint
                            'd.SetDatabaseDefaults()
                            'd.Position = Pt
                            'btr.AppendEntity(d)
                            'TR.AddNewlyCreatedDBObject(d, True)
                            Dim c As Circle = New Circle(Pt, Vector3d.ZAxis, 15)
                            c.ColorIndex = 1
                            btr.AppendEntity(c)
                            TR.AddNewlyCreatedDBObject(c, True)
                        Next
                    Next
                Next
                TR.Commit()
            End Using

        End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 14:12:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4649403#M46807</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-11-25T14:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: intersectwith between polyline and lines problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4651767#M46808</link>
      <description>Hi Alfred&lt;BR /&gt;&lt;BR /&gt;You're right, the Z coordinate is the problem.&lt;BR /&gt;&lt;BR /&gt;the mistake is why sometimes the intersection is found and sometime not&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Luc</description>
      <pubDate>Tue, 26 Nov 2013 07:50:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/intersectwith-between-polyline-and-lines-problem/m-p/4651767#M46808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-26T07:50:20Z</dc:date>
    </item>
  </channel>
</rss>

