<?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 Delete ImportedComponent from part environment in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-importedcomponent-from-part-environment/m-p/12156512#M156138</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have inserted the step file as imported component in inventor part environment.&lt;/P&gt;&lt;P&gt;and also added one button to delete that imported component.&amp;nbsp;&lt;/P&gt;&lt;P&gt;but seems like the importedComponent.delete() is not implemented.&lt;/P&gt;&lt;P&gt;getting error for delete();&lt;/P&gt;&lt;P&gt;Is anyone have idea about this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snehasadaphal_0-1691493588589.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1250554iFAA302E7E16AC5E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snehasadaphal_0-1691493588589.png" alt="snehasadaphal_0-1691493588589.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if (_document != null &amp;amp;&amp;amp; _document.DocumentType == DocumentTypeEnum.kPartDocumentObject)
            {
                PartDocument _oPart = _document as PartDocument;
                var oPartCompdef = _oPart.ComponentDefinition;                
                ImportedComponents impComps = oPartCompdef.ReferenceComponents.ImportedComponents;
                foreach (ImportedComponent CompOcc in impComps)
                {                   
                  string fileUrn = CompOcc.Name.Replace(".stp","");
                   if (exchangeItem.ExchangeID.Contains(fileUrn))
                   {
                       CompOcc.Delete();
                   }
                }

            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 11:20:38 GMT</pubDate>
    <dc:creator>sneha.sadaphal</dc:creator>
    <dc:date>2023-08-08T11:20:38Z</dc:date>
    <item>
      <title>Delete ImportedComponent from part environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-importedcomponent-from-part-environment/m-p/12156512#M156138</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have inserted the step file as imported component in inventor part environment.&lt;/P&gt;&lt;P&gt;and also added one button to delete that imported component.&amp;nbsp;&lt;/P&gt;&lt;P&gt;but seems like the importedComponent.delete() is not implemented.&lt;/P&gt;&lt;P&gt;getting error for delete();&lt;/P&gt;&lt;P&gt;Is anyone have idea about this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snehasadaphal_0-1691493588589.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1250554iFAA302E7E16AC5E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snehasadaphal_0-1691493588589.png" alt="snehasadaphal_0-1691493588589.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if (_document != null &amp;amp;&amp;amp; _document.DocumentType == DocumentTypeEnum.kPartDocumentObject)
            {
                PartDocument _oPart = _document as PartDocument;
                var oPartCompdef = _oPart.ComponentDefinition;                
                ImportedComponents impComps = oPartCompdef.ReferenceComponents.ImportedComponents;
                foreach (ImportedComponent CompOcc in impComps)
                {                   
                  string fileUrn = CompOcc.Name.Replace(".stp","");
                   if (exchangeItem.ExchangeID.Contains(fileUrn))
                   {
                       CompOcc.Delete();
                   }
                }

            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 11:20:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/delete-importedcomponent-from-part-environment/m-p/12156512#M156138</guid>
      <dc:creator>sneha.sadaphal</dc:creator>
      <dc:date>2023-08-08T11:20:38Z</dc:date>
    </item>
  </channel>
</rss>

