Is this method getFeaturesMethod(model) traverses the feature from IComponent2 interface or from IModelDoc2 interface? If this is IModelDoc2, are you using IComponent2::GetCorresponding? I think this is a possible issue.
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
myIntercad – an integrated tool for SolidWorks Professionals
For both methods, I am doing the following:
- IComponent2::GetChildren() (called recursively to get all the components)
So basically, I get all the child IModelDoc2 objects, and then call GetFeatures() on each one.
Yes, as I said you might need to have your pointers in the assembly context. Either traverse features on component level (IComponent2::FirstFeature) or convert the pointers using the IComponent2::GetCorresponding
Did this ever work for you Joshua?
I've run across the identical issue where BlankSketch works but not BlankRefGeo. Even with using GetCorresponding I still haven't had any luck.
Edit: Found the solution. Worked with the constituent parts as ModelDoc2 then selected the features with the assembly active using the constituent part as the component in the assembly and GetCorresponding.