AnsweredAssumed Answered

List feature external references in part using DocumentManager API

Question asked by Bruno Frade on Sep 4, 2019
Latest reply on Sep 4, 2019 by Bruno Frade


Can someone point me in the right direction on how to list feature external references in part using SwDocumentManager Api? 


the situation is with holes made in assembly => Edit part, and a hole created and centered based on other part,

now i would like to be able to replace the references in second file to other file... 

 so far i try with:


SwDMDocument18 swDocPart = swDocMgr.GetDocument(newPart, SwDmDocumentType.swDmDocumentPart, false, out nRetVal) as SwDMDocument18;
if(swDocPart != null)
string[] configs = swDocPart.ConfigurationManager.GetConfigurationNames();
if(configs != null)
foreach(string config in configs)
SwDMExternalReferenceOption2 dmExtRefOption = swDocMgr.GetExternalReferenceOptionObject2();
SwDMSearchOption dmSearchOpt = swDocMgr.GetSearchOptionObject();
dmExtRefOption.SearchOption = dmSearchOpt;
dmExtRefOption.Configuration = config;
dmExtRefOption.NeedSuppress = true;
int numRefs = swDocPart.GetExternalFeatureReferences2(dmExtRefOption);
Array arrExtRefs = (Array)(dmExtRefOption.ExternalReferences);


Thanks in advance

Bruno Frade.