<?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: Accessing component definition of Weldment in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255634#M73805</link>
    <description>&lt;P&gt;I get the same error with the code you just sent, traced it to this line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCD&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;in&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Document&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;AllReferencedDocuments&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;DocumentType&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;AssemblyDocument&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Type&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;ObjectTypeEnum&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kWeldmentComponentDefinitionObject&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'Dim oWCD As WeldmentComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'oCD = oWCD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'MsgBox(oWCD.Document.FullFileName)&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'Goto Continue1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            Else&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oACD As AssemblyComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oACD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            End If&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;        Else 'Part Doc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oSCD As SheetMetalComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oSCD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            Else&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oPCD As PartComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oPCD&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Next&lt;/SPAN&gt;
    
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Continue1:&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox(oCD.Document.FullFileName)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 14:18:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-26T14:18:12Z</dc:date>
    <item>
      <title>Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255447#M73802</link>
      <description>&lt;P&gt;I am running a for loop through AllReferencedDocuments in an assembly. Trying to access the component definition of any weldment assemblies using this line:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;wcd&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WeldmentComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;But I receive an error saying this:&lt;/P&gt;
&lt;P&gt;Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can write a rule inside the weldment assembly and access it from there:&lt;/P&gt;
&lt;P&gt;Dim oAssDoc As AssemblyDocument&lt;BR /&gt;oAssDoc = ThisApplication.ActiveDocument&lt;/P&gt;
&lt;P&gt;Dim wcd As WeldmentComponentDefinition&lt;BR /&gt;wcd = oAssDoc.ComponentDefinition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to access the component definition of any weldment assemblies from my top level rule, how do I do it?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 13:23:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255447#M73802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-26T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255579#M73803</link>
      <description>&lt;P&gt;Is there a good reason you need to use the specific WeldmentComponentDefinition instead of the generic ComponentDefinition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From my messing around with this, it appears to work just fine.... I'm assuming refdoc probably isn't actually a weldmentcomponentdefinition like you expect it to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()
	Dim oCD As ComponentDefinition
	
	For Each oSubDoc in ThisDoc.Document.AllReferencedDocuments
		If oSubDoc.DocumentType = kAssemblyDocumentObject 'AssemblyDocument
			If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kWeldmentComponentDefinitionObject
				Dim oWCD As WeldmentComponentDefinition = oSubDoc.ComponentDefinition
				oCD = oWCD
				MsgBox(oWCD.Document.FullFileName)
				Goto Continue1
			Else
				Dim oACD As AssemblyComponentDefinition = oSubDoc.ComponentDefinition
				oCD = oACD
			End If
		Else 'Part Doc
			If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject
				Dim oSCD As SheetMetalComponentDefinition = oSubDoc.ComponentDefinition
				oCD = oSCD
			Else
				Dim oPCD As PartComponentDefinition = oSubDoc.ComponentDefinition
				oCD = oPCD
			End If
		End If
	Next
	
Continue1:
	MsgBox(oCD.Document.FullFileName)

End Sub


'kVirtualComponentDefinitionObject - 100675072
'kWeldmentComponentDefinitionObject - 100673280
'kAssemblyComponentDefinitionObject - 100663808
'kPartComponentDefinitionObject - 83886592
'kSheetMetalComponentDefinitionObject - 150995200&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:03:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255579#M73803</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-07-26T14:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255634#M73805</link>
      <description>&lt;P&gt;I get the same error with the code you just sent, traced it to this line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCD&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;in&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Document&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;AllReferencedDocuments&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;DocumentType&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;AssemblyDocument&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSubDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Type&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;ObjectTypeEnum&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kWeldmentComponentDefinitionObject&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'Dim oWCD As WeldmentComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'oCD = oWCD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'MsgBox(oWCD.Document.FullFileName)&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                'Goto Continue1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            Else&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oACD As AssemblyComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oACD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            End If&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;        Else 'Part Doc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oSCD As SheetMetalComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oSCD&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;            Else&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                Dim oPCD As PartComponentDefinition = oSubDoc.ComponentDefinition&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;                oCD = oPCD&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Next&lt;/SPAN&gt;
    
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Continue1:&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox(oCD.Document.FullFileName)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:18:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255634#M73805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-26T14:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255648#M73806</link>
      <description>&lt;P&gt;Ok. So is there anything special about the document it is failing on, or is it definitely failing for every document?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255648#M73806</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-07-26T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255698#M73808</link>
      <description>&lt;P&gt;Just tried creating a new blank weldment from scratch and it worked for that. Not sure what's wrong with the original, I converted it to a weldment from a standard assembly.&lt;/P&gt;
&lt;P&gt;In the one that's giving me issues I can access the component definition from&amp;nbsp;this rule inside it, so I don't know why it doesn't like it from my other rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oAssDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oAssDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;wcd&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;WeldmentComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;wcd&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oAssDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oEachWeldB&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;WeldBead&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;WeldCount&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;wcd&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Welds&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;WeldBeads&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Count&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;MsgBox&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;WeldCount&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:33:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255698#M73808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-26T14:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255764#M73809</link>
      <description>&lt;P&gt;I saved a copy of the problem assembly, replaced the original with the copy in my assembly, ran the rule and it works fine on that. Swapped the copy back to the original, ran the rule and it fails. Both files are identical apart from their filename.&amp;nbsp;&lt;img id="smileymad" class="emoticon emoticon-smileymad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-mad.png" alt="Smiley Mad" title="Smiley Mad" /&gt;&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:54:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255764#M73809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-26T14:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing component definition of Weldment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255912#M73811</link>
      <description>&lt;P&gt;I'm curious how it works if you try it just typed as ComponentDefinition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oAssDoc As AssemblyDocument
oAssDoc = ThisApplication.ActiveDocument

&lt;STRONG&gt;Dim wcd As ComponentDefinition&lt;/STRONG&gt;
wcd = oAssDoc.ComponentDefinition

Dim oEachWeldB As WeldBead

WeldCount = wcd.Welds.WeldBeads.Count

MsgBox(WeldCount)&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-component-definition-of-weldment/m-p/7255912#M73811</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-07-26T15:43:01Z</dc:date>
    </item>
  </channel>
</rss>

