<?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 How to understand the API object model? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9849863#M56350</link>
    <description>&lt;P&gt;Hello, everybody.&lt;BR /&gt;I am very interested in Inventor customization. But as for a non-programmer it can be very difficult to understand some features. I would really appreciate it if someone could explain the next thing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In API.pdf we can see object model.&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-center" image-alt="Безымянный2.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/840993i26D197C646A64469/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Безымянный2.PNG" alt="Безымянный2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same thing in the API help book:&lt;BR /&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Безымянный.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/840994i63FB2B002E3EE2FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Безымянный.png" alt="Безымянный.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the top level, we see the application. Next comes the various documents, and then goes specific structure of the document.&lt;/P&gt;&lt;P&gt;For examle&lt;/P&gt;&lt;P&gt;"PartDocument - &lt;STRONG&gt;PartDocumentDefinition - PartFeatures&lt;/STRONG&gt;";&lt;/P&gt;&lt;P&gt;"AssemblyDocument -&amp;nbsp;&lt;STRONG&gt;AssemblyDocumentDefinition&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if we try to use something like this:&lt;/P&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;&lt;LI-CODE lang="general"&gt;Dim partDoc as PartDocument = ThisApplication.ActiveDocument

Dim extrude As ExtrudeFeature = partDoc.PartComponentDefinition.PartFeatures.ExtrudeFeatures.Item(1)&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;&lt;P&gt;this will not work, because there is no such a thing as "&lt;STRONG&gt;PartDocumentDefinition&lt;/STRONG&gt;" or "&lt;STRONG&gt;AssemblyDocumentDefinition&lt;/STRONG&gt;" and there is no "&lt;STRONG&gt;PartFeatures&lt;/STRONG&gt;" thing too. Instead we should use "partDoc.&lt;STRONG&gt;ComponentDefinition&lt;/STRONG&gt;" and "&lt;STRONG&gt;Features&lt;/STRONG&gt;" as it is shown in API help examples...&lt;/P&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;&lt;LI-CODE lang="general"&gt;Dim partDoc as PartDocument = ThisApplication.ActiveDocument

   Dim extrude As ExtrudeFeature
   extrude = partDoc.ComponentDefinition.Features.ExtrudeFeatures.Item(1)&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;&lt;P&gt;First, they provide a theory and then give examples that do not match it. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;And it drives me crazy... I don't understand how to use this table then, if we can't believe it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I couldn't find any explanation in the help for this issue. Perhaps, there is certain "general idea" that makes this transition in&amp;nbsp;syntax understandable. If so, please share it with me. And if this example is just an exception, can you tell if there are other similar exceptions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Nov 2020 10:06:29 GMT</pubDate>
    <dc:creator>mikhail_tsarev</dc:creator>
    <dc:date>2020-11-06T10:06:29Z</dc:date>
    <item>
      <title>How to understand the API object model?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9849863#M56350</link>
      <description>&lt;P&gt;Hello, everybody.&lt;BR /&gt;I am very interested in Inventor customization. But as for a non-programmer it can be very difficult to understand some features. I would really appreciate it if someone could explain the next thing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In API.pdf we can see object model.&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-center" image-alt="Безымянный2.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/840993i26D197C646A64469/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Безымянный2.PNG" alt="Безымянный2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same thing in the API help book:&lt;BR /&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Безымянный.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/840994i63FB2B002E3EE2FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Безымянный.png" alt="Безымянный.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the top level, we see the application. Next comes the various documents, and then goes specific structure of the document.&lt;/P&gt;&lt;P&gt;For examle&lt;/P&gt;&lt;P&gt;"PartDocument - &lt;STRONG&gt;PartDocumentDefinition - PartFeatures&lt;/STRONG&gt;";&lt;/P&gt;&lt;P&gt;"AssemblyDocument -&amp;nbsp;&lt;STRONG&gt;AssemblyDocumentDefinition&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if we try to use something like this:&lt;/P&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;&lt;LI-CODE lang="general"&gt;Dim partDoc as PartDocument = ThisApplication.ActiveDocument

Dim extrude As ExtrudeFeature = partDoc.PartComponentDefinition.PartFeatures.ExtrudeFeatures.Item(1)&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;&lt;P&gt;this will not work, because there is no such a thing as "&lt;STRONG&gt;PartDocumentDefinition&lt;/STRONG&gt;" or "&lt;STRONG&gt;AssemblyDocumentDefinition&lt;/STRONG&gt;" and there is no "&lt;STRONG&gt;PartFeatures&lt;/STRONG&gt;" thing too. Instead we should use "partDoc.&lt;STRONG&gt;ComponentDefinition&lt;/STRONG&gt;" and "&lt;STRONG&gt;Features&lt;/STRONG&gt;" as it is shown in API help examples...&lt;/P&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;&lt;LI-CODE lang="general"&gt;Dim partDoc as PartDocument = ThisApplication.ActiveDocument

   Dim extrude As ExtrudeFeature
   extrude = partDoc.ComponentDefinition.Features.ExtrudeFeatures.Item(1)&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;&lt;P&gt;First, they provide a theory and then give examples that do not match it. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;And it drives me crazy... I don't understand how to use this table then, if we can't believe it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I couldn't find any explanation in the help for this issue. Perhaps, there is certain "general idea" that makes this transition in&amp;nbsp;syntax understandable. If so, please share it with me. And if this example is just an exception, can you tell if there are other similar exceptions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 10:06:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9849863#M56350</guid>
      <dc:creator>mikhail_tsarev</dc:creator>
      <dc:date>2020-11-06T10:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to understand the API object model?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9850055#M56351</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3537266"&gt;@mikhail_tsarev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The object model represents the classes, not the references. For example PartDocument.ComponentDefinition is an object of type (class) PartComponentDefinition. The reference to reach it is .ComponentDefinition, this does not mean that the class name is ComponentDefinition. In this case however PartComponentDefinition is derived from the class ComponentDefinition, so you can write for example:&lt;/P&gt;
&lt;P&gt;Dim oDef As ComponentDefinition = PartDocument.ComponentDefinition&lt;/P&gt;
&lt;P&gt;ComponentDefinition is the base class of both PartComponentDefinition and AssemblyComponentDefinition.&lt;/P&gt;
&lt;P&gt;The point though is that there's a difference between the property name containing the object and the object type (class name).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you're looking for is the API reference manual. It will show you how to reference the different objects:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-C5FA9FB4-A7AD-47B3-9BA9-1EFF8B55388D" target="_blank"&gt;https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-C5FA9FB4-A7AD-47B3-9BA9-1EFF8B55388D&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReferenceManual.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/841050i979600CE6372519D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ReferenceManual.PNG" alt="ReferenceManual.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 11:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9850055#M56351</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-11-06T11:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to understand the API object model?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9850126#M56352</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3537266"&gt;@mikhail_tsarev&lt;/a&gt;&amp;nbsp; Also watch this video of Brian Ekins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.autodesk.com/autodesk-university/class/iLogic-and-Inventor-API-2016#video" target="_blank" rel="noopener"&gt;https://www.autodesk.com/autodesk-university/class/iLogic-and-Inventor-API-2016#video&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 11:43:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9850126#M56352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-06T11:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to understand the API object model?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9853569#M56353</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;I'm not sure I fully understood everything you wrote, as I do not have enough theoretical knowledge on object-oriented programming. But now I have a direction to develop and a common understanding of the subject!&lt;/P&gt;&lt;P&gt;You have helped me a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Anonymous&amp;nbsp;Thank you very much! I watched this video with great pleasure! The author explains the material very clearly.&lt;BR /&gt;It's a pity that there is no complete tutorial or a book about programming for Inventor .&lt;BR /&gt;I took a videocourse on VB.NET from Bob Tabor. It's a very good course, but it covers a bit different parts of the language than the ones used in the Inventor API. Although I have definitely learned something.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp;Also, I apologize for mistakes in my&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;messages, English is not my native language.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 09:09:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-understand-the-api-object-model/m-p/9853569#M56353</guid>
      <dc:creator>mikhail_tsarev</dc:creator>
      <dc:date>2020-11-08T09:09:05Z</dc:date>
    </item>
  </channel>
</rss>

