<?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: Extract Contours from Surface using from external application in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8551087#M10574</link>
    <description>&lt;P&gt;I am not familiar with the tools you are using or customization, but here is a thought:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Contours are not Civl 3D objects. They are a graphic representation of a Civil 3D Surface object. That representation is generated as needed. They only look like polylines. You can extract contours from a surface using SURFACEEXTRACTOBJECTS. The extracted "contours" are polylines. (3D)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Programmatically I think your would needs to first extract the contours, from a surface, to polylines, then extract the resulting polylines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SURFACEEXTRACTOBJECTS first prompts for a surface then displays a dialog box where you can pick what displayed objects to extract.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the dialog box does seems to be set up for mouse navigation/selection only. The surface style display option controls which object are available for extraction. (e.g. If Border is not displayed in the style, it will not bwe displayed&amp;nbsp;&lt;EM&gt;and&lt;/EM&gt; it will not be available for extraction.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. Good Luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/595557i1AFAC534A56BCFB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jan 2019 03:06:02 GMT</pubDate>
    <dc:creator>ChrisRS</dc:creator>
    <dc:date>2019-01-26T03:06:02Z</dc:date>
    <item>
      <title>Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8414902#M10569</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;I'm struggling trying to extract contours from an external application (Grasshopper node) using the AECC interface.&lt;/P&gt;
&lt;PRE&gt;AeccTinSurface tinSurf = surface._Surface as AeccTinSurface;

            dynamic surfContours = tinSurf.ExtractContour(
                AeccDisplayOrientation.aeccDisplayOrientationPlan,
                AeccSurfaceFilterType.aeccSFMajorContours,
                tinSurf.Statistics.MinElevation,
                tinSurf.Statistics.MaxElevation
                );
            double surfcontnum = surfContours.Length;
            List&amp;lt;object&amp;gt; crvs = new List&amp;lt;object&amp;gt;();

            for (int i = 0; i &amp;lt; surfContours.Length; i++)
            {
                dynamic pL = surfContours[i];
                Type pInfo = pL.GetType();
                crvs.Add(pInfo);
            }&lt;/PRE&gt;
&lt;P&gt;This code results in a list of System.__COMObject. In all other cases like ALignments and profile I'm able to cast to a specific type but not in this case.&lt;/P&gt;
&lt;P&gt;Does anyone have an explanation or some idea regarding this?&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Cesare&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 23:22:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8414902#M10569</guid>
      <dc:creator>CaoduroC</dc:creator>
      <dc:date>2018-11-20T23:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8415390#M10570</link>
      <description>&lt;P&gt;Of course if there is any better or more clever way to deal with Civil 3D native object from an external application, rather than using COM objects, that will be perfect!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 06:14:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8415390#M10570</guid>
      <dc:creator>CaoduroC</dc:creator>
      <dc:date>2018-11-21T06:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8425718#M10571</link>
      <description>&lt;P&gt;COM is the way to interact from out-of-process, but you can expose .NET through COM (a bit more complicated).&lt;/P&gt;
&lt;P&gt;In this case, I believe the ExtractCountours should return a list of Objects, so at the higher level, an AcadObject (which can be anything on the drawing)&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 20:49:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8425718#M10571</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2018-11-26T20:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8425782#M10572</link>
      <description>I've extracted the object for many other things but in this case, I can't really cast to any kind of object in Rhino or Dynamo.&lt;BR /&gt;I can see that is a polyline CAD Object but keeps giving me the same error.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Nov 2018 21:24:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8425782#M10572</guid>
      <dc:creator>CaoduroC</dc:creator>
      <dc:date>2018-11-26T21:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8431924#M10573</link>
      <description>&lt;P&gt;That's exactly the way I'm extracting all other object from a civil 3d active document. Only contours are not working!&lt;/P&gt;
&lt;P&gt;I can see that they're polylines in the CAD environment but I can't cast them to anything.&lt;/P&gt;
&lt;P&gt;Can you help me with a code sample?&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Cesare&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 00:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8431924#M10573</guid>
      <dc:creator>CaoduroC</dc:creator>
      <dc:date>2018-11-29T00:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8551087#M10574</link>
      <description>&lt;P&gt;I am not familiar with the tools you are using or customization, but here is a thought:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Contours are not Civl 3D objects. They are a graphic representation of a Civil 3D Surface object. That representation is generated as needed. They only look like polylines. You can extract contours from a surface using SURFACEEXTRACTOBJECTS. The extracted "contours" are polylines. (3D)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Programmatically I think your would needs to first extract the contours, from a surface, to polylines, then extract the resulting polylines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SURFACEEXTRACTOBJECTS first prompts for a surface then displays a dialog box where you can pick what displayed objects to extract.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the dialog box does seems to be set up for mouse navigation/selection only. The surface style display option controls which object are available for extraction. (e.g. If Border is not displayed in the style, it will not bwe displayed&amp;nbsp;&lt;EM&gt;and&lt;/EM&gt; it will not be available for extraction.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. Good Luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/595557i1AFAC534A56BCFB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jan 2019 03:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/8551087#M10574</guid>
      <dc:creator>ChrisRS</dc:creator>
      <dc:date>2019-01-26T03:06:02Z</dc:date>
    </item>
    <item>
      <title>回复： Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/9573669#M10575</link>
      <description>&lt;P&gt;Have you solved this problem?&lt;/P&gt;
&lt;P&gt;If it has been solved，&lt;/P&gt;
&lt;P&gt;Can you share your solution?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:14:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/9573669#M10575</guid>
      <dc:creator>465340553</dc:creator>
      <dc:date>2020-06-11T08:14:28Z</dc:date>
    </item>
    <item>
      <title>回复： Extract Contours from Surface using from external application</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/9575457#M10576</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class="" title=""&gt;My problem is solved like this&lt;/SPAN&gt;&lt;/SPAN&gt;：&lt;/P&gt;
&lt;P&gt;I cast contour to acadlwpolyline。&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;AeccTinVolumeSurface aeccTVS = _comDoc.ObjectIdToObject((volumeSurfaceId.OldIdPtr).ToInt64()) as AeccTinVolumeSurface;
IEnumerable contours = aeccTVS.ExtractContour(AeccDisplayOrientation.aeccDisplayOrientationPlan, AeccSurfaceFilterType.aeccSFMajorContours, 0, 0) as IEnumerable;
List&amp;lt;Point2dCollection&amp;gt; ptss = new List&amp;lt;Point2dCollection&amp;gt;();
foreach (var contour in contours)
{
    AcadLWPolyline pl  = contour as AcadLWPolyline;
    if (pl != null)
    {
        Point2dCollection pts = new Point2dCollection();
        double[] cors= pl.Coordinates as double[];
        for (int i = 0; i &amp;lt; cors.Length - 2; i += 2) 
        {
            pts.Add(new Point2d(cors[i], cors[i+1]));
        }
        ptss.Add(pts);
        pl.Delete();
    }
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 23:40:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/extract-contours-from-surface-using-from-external-application/m-p/9575457#M10576</guid>
      <dc:creator>465340553</dc:creator>
      <dc:date>2020-06-11T23:40:40Z</dc:date>
    </item>
  </channel>
</rss>

