<?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: GetIntersectWith ( ) without drawing entities? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6674710#M33897</link>
    <description>&lt;P&gt;I did such as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/826400"&gt;@Virupaksha_aithal﻿&lt;/a&gt;&amp;nbsp;said, so now I create the line just once and finally I remove it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I have noticed that actually this is not the issue about taking a lot of time. The issue is the "Surface.GetIntersectionPoint( ) method (C3D API) where I need to find the intersection of my sight to the surface and my surface has a huge amount of TIN triangles. In addition, I do this iteration every 2 meters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My idea is increasing this first&amp;nbsp;iteration , for example every 20 meters and then apply a sub-iteration (every 1 meter) once there is no solution (intersection has found).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2016 15:51:18 GMT</pubDate>
    <dc:creator>joantopo</dc:creator>
    <dc:date>2016-11-08T15:51:18Z</dc:date>
    <item>
      <title>GetIntersectWith ( ) without drawing entities?</title>
      <link>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673198#M33894</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;I have a polyline in my drawing and I have to repeat a lot of times the operation to create a line and find out the intersection point with the pokyline.&lt;/P&gt;
&lt;P&gt;RIght now, I create the line and then I erase it . &amp;nbsp; entity.Erase ( )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is I want to avoid this step ( create the line and then erase it) because I said, maybe my command needs to do this operation thousands of times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, what could I do? &amp;nbsp;maybe with "drawable" objects...although I have never used them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 23:42:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673198#M33894</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-11-07T23:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: GetIntersectWith ( ) without drawing entities?</title>
      <link>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673483#M33895</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try modify the line (set new start and end point of the line) instead of erase and recreating the new entity.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 06:03:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673483#M33895</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2016-11-08T06:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: GetIntersectWith ( ) without drawing entities?</title>
      <link>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673589#M33896</link>
      <description>&lt;P&gt;You don't have to add the Line object to the database to find the intersection... this will save lot of time and you won't need to erase it.&lt;/P&gt;
&lt;P&gt;Just create the object in memory, even reusing the same symbol if you want, but don't add it to the transaction and to the database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I see now you want to use the IntersectWith() function, that require an ObjectID... maybe you can work in 2D using the Line2d.IntersectWith() function. Here a C# function that will return an array of 2D points:&lt;/P&gt;
&lt;P&gt;Later you can convert to 3D using the polyline Plane, if you need it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        public static Point2d[] PLineGetIntersection(Polyline p, Line2d vector)
        {
            if (p == null) return null;
            if (vector == null) return null;

            List&amp;lt;Point2d&amp;gt; vp = new List&amp;lt;Point2d&amp;gt;();

            Point2d[] result = null;
            Tolerance t = new Tolerance(0.1, 0.1);

            for (int i = 0; i &amp;lt; p.NumberOfVertices; i++)
            {
                result = null;
                switch (p.GetSegmentType(i))
                {
                    case SegmentType.Line:
                        LineSegment2d lp = p.GetLineSegment2dAt(i);
                        result = lp.IntersectWith(vector, t);
                        break;

                    case SegmentType.Arc:
                        CircularArc2d ap = p.GetArcSegment2dAt(i);
                        result = ap.IntersectWith(vector, t);
                        break;
                }

                // add partial results to final list
                if (result != null) vp.AddRange(result);
            }

            // convert list to Array as return value
            result = null;
            if (vp.Count &amp;gt; 0) result = vp.ToArray();

            return result;
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 07:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6673589#M33896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-08T07:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: GetIntersectWith ( ) without drawing entities?</title>
      <link>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6674710#M33897</link>
      <description>&lt;P&gt;I did such as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/826400"&gt;@Virupaksha_aithal﻿&lt;/a&gt;&amp;nbsp;said, so now I create the line just once and finally I remove it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I have noticed that actually this is not the issue about taking a lot of time. The issue is the "Surface.GetIntersectionPoint( ) method (C3D API) where I need to find the intersection of my sight to the surface and my surface has a huge amount of TIN triangles. In addition, I do this iteration every 2 meters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My idea is increasing this first&amp;nbsp;iteration , for example every 20 meters and then apply a sub-iteration (every 1 meter) once there is no solution (intersection has found).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:51:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getintersectwith-without-drawing-entities/m-p/6674710#M33897</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-11-08T15:51:18Z</dc:date>
    </item>
  </channel>
</rss>

