<?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: How to extract polylines from surface contours in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297771#M23742</link>
    <description>Hi Rasmus,&lt;BR /&gt;
The Contours collection of a TinSurface are strictly polylines that are used &lt;BR /&gt;
to DEFINE the surface. If none were used due to the surface being defined by &lt;BR /&gt;
Points &amp;amp; Breaklines then the collection will be empty.&lt;BR /&gt;
&lt;BR /&gt;
To get the polylines used to display the resulting surface, first you must &lt;BR /&gt;
have 2009. Second, the TinSurface object in 2009 has an ExtractContour &lt;BR /&gt;
method which allows you to specify a range of elevations, Major Minor or &lt;BR /&gt;
User Defined Contours, and what View to extract. I believe this is what you &lt;BR /&gt;
are looking for.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Jeff&lt;BR /&gt;
&lt;BR /&gt;
"Rasmus Bugge" wrote in message news:5979220@discussion.autodesk.com...&lt;BR /&gt;
I have gotten hold of a COM pointer to an AeccSurfaceContour object, and &lt;BR /&gt;
also the object's ContourEntities stored in a VARIANT array (of VT_I4's, I &lt;BR /&gt;
presume).&lt;BR /&gt;
&lt;BR /&gt;
However, if I try to access the elements in the array (using &lt;BR /&gt;
SafeArrayAccessData) and convert them to AcDbObjectIds by doing the &lt;BR /&gt;
following:&lt;BR /&gt;
&lt;BR /&gt;
AcDbObjectId objId;&lt;BR /&gt;
objId.setFromOldId (array&lt;I&gt;);//presume 'i' is an index into the array&lt;BR /&gt;
bool isIdValid = objId.isValid();&lt;BR /&gt;
&lt;BR /&gt;
then isIdValid is false and hence when I try to use it in functions like &lt;BR /&gt;
AcAxGetIUnknownOfObject () or acdbOpenObject(), they return with an error &lt;BR /&gt;
and an unhandled exception, respectively.&lt;BR /&gt;
&lt;BR /&gt;
What is stored in the VARIANT array and how do I use the values to get hold &lt;BR /&gt;
of the polylines that represent the contours?&lt;BR /&gt;
&lt;BR /&gt;
Rasmus Bugge&lt;/I&gt;</description>
    <pubDate>Fri, 11 Jul 2008 15:30:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-07-11T15:30:28Z</dc:date>
    <item>
      <title>How to extract polylines from surface contours</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297770#M23741</link>
      <description>I have gotten hold of a COM pointer to an AeccSurfaceContour object, and also the object's ContourEntities stored in a VARIANT array (of VT_I4's, I presume).&lt;BR /&gt;
&lt;BR /&gt;
However, if I try to access the elements in the array (using SafeArrayAccessData) and convert them to AcDbObjectIds by doing the following:&lt;BR /&gt;
&lt;BR /&gt;
AcDbObjectId objId;&lt;BR /&gt;
objId.setFromOldId (array&lt;I&gt;);//presume 'i' is an index into the array&lt;BR /&gt;
bool isIdValid = objId.isValid();&lt;BR /&gt;
&lt;BR /&gt;
then isIdValid is false and hence when I try to use it in functions like AcAxGetIUnknownOfObject () or acdbOpenObject(), they return with an error and an unhandled exception, respectively.&lt;BR /&gt;
&lt;BR /&gt;
What is stored in the VARIANT array and how do I use the values to get hold of the polylines that represent the contours?&lt;BR /&gt;
&lt;BR /&gt;
Rasmus Bugge&lt;/I&gt;</description>
      <pubDate>Fri, 11 Jul 2008 11:50:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297770#M23741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-11T11:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract polylines from surface contours</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297771#M23742</link>
      <description>Hi Rasmus,&lt;BR /&gt;
The Contours collection of a TinSurface are strictly polylines that are used &lt;BR /&gt;
to DEFINE the surface. If none were used due to the surface being defined by &lt;BR /&gt;
Points &amp;amp; Breaklines then the collection will be empty.&lt;BR /&gt;
&lt;BR /&gt;
To get the polylines used to display the resulting surface, first you must &lt;BR /&gt;
have 2009. Second, the TinSurface object in 2009 has an ExtractContour &lt;BR /&gt;
method which allows you to specify a range of elevations, Major Minor or &lt;BR /&gt;
User Defined Contours, and what View to extract. I believe this is what you &lt;BR /&gt;
are looking for.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Jeff&lt;BR /&gt;
&lt;BR /&gt;
"Rasmus Bugge" wrote in message news:5979220@discussion.autodesk.com...&lt;BR /&gt;
I have gotten hold of a COM pointer to an AeccSurfaceContour object, and &lt;BR /&gt;
also the object's ContourEntities stored in a VARIANT array (of VT_I4's, I &lt;BR /&gt;
presume).&lt;BR /&gt;
&lt;BR /&gt;
However, if I try to access the elements in the array (using &lt;BR /&gt;
SafeArrayAccessData) and convert them to AcDbObjectIds by doing the &lt;BR /&gt;
following:&lt;BR /&gt;
&lt;BR /&gt;
AcDbObjectId objId;&lt;BR /&gt;
objId.setFromOldId (array&lt;I&gt;);//presume 'i' is an index into the array&lt;BR /&gt;
bool isIdValid = objId.isValid();&lt;BR /&gt;
&lt;BR /&gt;
then isIdValid is false and hence when I try to use it in functions like &lt;BR /&gt;
AcAxGetIUnknownOfObject () or acdbOpenObject(), they return with an error &lt;BR /&gt;
and an unhandled exception, respectively.&lt;BR /&gt;
&lt;BR /&gt;
What is stored in the VARIANT array and how do I use the values to get hold &lt;BR /&gt;
of the polylines that represent the contours?&lt;BR /&gt;
&lt;BR /&gt;
Rasmus Bugge&lt;/I&gt;</description>
      <pubDate>Fri, 11 Jul 2008 15:30:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297771#M23742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-11T15:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract polylines from surface contours</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297772#M23743</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply.Yes, I have also realized that ExtractContour is the function to use...However, one question remains (as I use C++): What type is the VARIANT*? Is it a VT_VOID | VT_ARRAY? And am I supposed to cast from VOID to AcDbEntity*?&lt;BR /&gt;
&lt;BR /&gt;
Rasmus Bugge</description>
      <pubDate>Mon, 14 Jul 2008 08:25:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297772#M23743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-14T08:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract polylines from surface contours</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297773#M23744</link>
      <description>Case closed.</description>
      <pubDate>Mon, 14 Jul 2008 14:28:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-extract-polylines-from-surface-contours/m-p/2297773#M23744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-14T14:28:22Z</dc:date>
    </item>
  </channel>
</rss>

