I'm not sure how I would use try / catch in the context of the combine feature.
I need a boolean value to test if the combine feature was successful or has failed, to react to this in code.
Any input welcome!
You could check and see if the Feature that this function returns is null or not. If it's null then it failed.
2013 SOLIDWORKS API Help - InsertCombineFeature Method (IFeatureManager)
I'm still trying to find a solution on this.
For the case where I have e.g. 2 boxes that don't touch and I run a combine, the combine will fail.
How can I try/catch this?
Thanks for the input!
Here's the code that works:
Set swFeatureMgr = swModel.FeatureManager
Set swFeature = swFeatureMgr.InsertCombineFeature(15903, Nothing, Nothing)
If Not swFeature Is Nothing Then
Before you run the code, check with imodeler if the bodies intersect.
Retrieving data ...