<?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: acedssget for COM accessed objects in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11101087#M2609</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/556255"&gt;@zrobert&lt;/a&gt;, I will explore the&amp;nbsp;&lt;SPAN&gt;ObjectIdToObject method and report back.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 14:43:27 GMT</pubDate>
    <dc:creator>karl.sch1983</dc:creator>
    <dc:date>2022-04-12T14:43:27Z</dc:date>
    <item>
      <title>acedssget for COM accessed objects</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11099273#M2607</link>
      <description>&lt;P&gt;I had a previous post &lt;A href="https://forums.autodesk.com/t5/objectarx/civil-3d-using-com/m-p/10878397" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;to access Civil 3d objects. Thanks to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/556255"&gt;@zrobert&lt;/a&gt;&amp;nbsp;I successfully created the application and was able to manipulate those by accessing properties of relevant objects through com. Taking it to the next step, I got a request to pick an object in the editor and then manipulate its properties. I just cant seem to successfully get the relationship between the picked entity and casting/converting it to the necessary object to manipulate it. I looked at &lt;A href="https://forums.autodesk.com/t5/objectarx/iterate-through-selected-custom-entities-and-change-thier/td-p/8454718" target="_blank" rel="noopener"&gt;this&lt;/A&gt; post and tried to implement something similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;AcDbObjectId id; acdbGetObjectId(id, en);
AcDbObjectPointer&amp;lt;IAeccSurfacePtr&amp;gt; pEnt(id, AcDb::kForWrite);	// is this correct for accessing a surface?

if (pEnt.openStatus() == Acad::eOk)
{
	//manipulate pEnt properties
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of course it fails.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="karlsch1983_0-1649709238246.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1053582i5814FA9185CD7CBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="karlsch1983_0-1649709238246.png" alt="karlsch1983_0-1649709238246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can someone please provide any helpful info on how to cast to the right entity. Any helpful links? I have googled over several days and cannot find anything. I just need to be able to manipulate the picked civil 3d entity which is a surface. Thanks for all your help in advance.&lt;/P&gt;&lt;P&gt;p.s. I also posted this in the Civil3D customization forums &lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/acedsssget-and-com-accessed-objects/td-p/11099272" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 20:42:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11099273#M2607</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2022-04-11T20:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: acedssget for COM accessed objects</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11100036#M2608</link>
      <description>&lt;P&gt;Hello Karl;&lt;/P&gt;&lt;P&gt;I haven't specifically used object selection in a COM environment, but I think this might help you.&lt;BR /&gt;This is a &lt;A href="https://www.keanw.com/2007/02/using_the_com_i.html" target="_blank" rel="noopener"&gt;link&lt;/A&gt; to Kean's blog where he explains the "conversion" of the classic ObjectId to a COM object.&lt;BR /&gt;This is a .NET environment, however, the essential line of code is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Let's use the COM API to get a COM reference&lt;BR /&gt;// to the hatch (as a base object)&lt;/P&gt;&lt;P&gt;object obj2 = oAcad.ActiveDocument.ObjectIdToObject(&lt;BR /&gt;obj.ObjectId.OldId&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;The IAcadDocument* object in the c++ environment also has this method (ObjectIdToObject).&lt;BR /&gt;So, when you get the ObjectID, try to convert it to a COM object this way.&lt;BR /&gt;I hope it helps you.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 06:30:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11100036#M2608</guid>
      <dc:creator>zrobert</dc:creator>
      <dc:date>2022-04-12T06:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: acedssget for COM accessed objects</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11101087#M2609</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/556255"&gt;@zrobert&lt;/a&gt;, I will explore the&amp;nbsp;&lt;SPAN&gt;ObjectIdToObject method and report back.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 14:43:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedssget-for-com-accessed-objects/m-p/11101087#M2609</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2022-04-12T14:43:27Z</dc:date>
    </item>
  </channel>
</rss>

