<?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 convert ObjectId to MapObjectId in AutoCAD Map 3D Developer Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2344562#M2737</link>
    <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I basically need to iterate through every single objects in my drawings (the drawing project and attached drawings). Then I need to keep in memory the ID of each objects. It seems that MapObjectId is what I should use (instead of ObjectId which is not persistent through load/unload of attached drawings).&lt;BR /&gt;
&lt;BR /&gt;
I have to ways to iterate through my objects:&lt;BR /&gt;
&lt;BR /&gt;
1) Iterate on the project drawing's objects. But then how am I supposed to convert ObjectId to MapObjectID ? It seems that I need to know which drawing the object is coming from. Is there a way to obtain an object's origin ? or directly convert an ObjectId to a MapObjectId (with some static methods) ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
2) Iterate on each attached drawings and for each objects build a MapObjectId (via MapObjectId.Init() function). Then I still need to iterate through the project drawing's objects. The problem is I will get all attached objects one more time. This obviously a huge performance issue. Is there a way to "avoid" attached objects and only iterate through project's drawing's objects ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
TIA</description>
    <pubDate>Wed, 17 Sep 2008 09:54:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-09-17T09:54:59Z</dc:date>
    <item>
      <title>convert ObjectId to MapObjectId</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2344562#M2737</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I basically need to iterate through every single objects in my drawings (the drawing project and attached drawings). Then I need to keep in memory the ID of each objects. It seems that MapObjectId is what I should use (instead of ObjectId which is not persistent through load/unload of attached drawings).&lt;BR /&gt;
&lt;BR /&gt;
I have to ways to iterate through my objects:&lt;BR /&gt;
&lt;BR /&gt;
1) Iterate on the project drawing's objects. But then how am I supposed to convert ObjectId to MapObjectID ? It seems that I need to know which drawing the object is coming from. Is there a way to obtain an object's origin ? or directly convert an ObjectId to a MapObjectId (with some static methods) ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
2) Iterate on each attached drawings and for each objects build a MapObjectId (via MapObjectId.Init() function). Then I still need to iterate through the project drawing's objects. The problem is I will get all attached objects one more time. This obviously a huge performance issue. Is there a way to "avoid" attached objects and only iterate through project's drawing's objects ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
TIA</description>
      <pubDate>Wed, 17 Sep 2008 09:54:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2344562#M2737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-09-17T09:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: convert ObjectId to MapObjectId</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2344563#M2738</link>
      <description>My needs changed and therefore I don't use this approach anymore. However for the sake of for the sake of completeness, here is the simple way to do what I wanted:&lt;BR /&gt;
&lt;BR /&gt;
Iterate on project drawing objects&lt;BR /&gt;
Get the object's origin drawing using: HostMapApplicationServices.Application.ActiveProject.GetSourceDrawingId(id);&lt;BR /&gt;
Build a MapObjectId using: MapObjectId.Init();&lt;BR /&gt;
&lt;BR /&gt;
Beware of exception thrown if the object is not queried from an attached drawing.</description>
      <pubDate>Fri, 31 Oct 2008 08:24:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2344563#M2738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-31T08:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: convert ObjectId to MapObjectId</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2698644#M2739</link>
      <description>&lt;P&gt;Could you please add a sample of your code that uses MapObjectId? I would help A LOT !! Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2010 07:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/convert-objectid-to-mapobjectid/m-p/2698644#M2739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-18T07:57:04Z</dc:date>
    </item>
  </channel>
</rss>

