Delete ImportedComponent from part environment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have inserted the step file as imported component in inventor part environment.
and also added one button to delete that imported component.
but seems like the importedComponent.delete() is not implemented.
getting error for delete();
Is anyone have idea about this?
if (_document != null && _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();
}
}
}