Is there a way to set or edit the target bodies when creating a split body from the api? I basically want to set the scope to only split one body in a multi-body part.
Sorry for the misunderstanding.
This seems to be an open issue: SPR 1042250
It has a High priority.
There are few ways you can select the body, it depends on how the bodies are made and what type. Could you attach your part to give a specific option?
Hello Nilesh, unfortunately I am unable to share any information about the end use, and definitely cannot share the part. I didn't see any ways to specify a target body in the API help files, maybe you could share how to set one target body. An example would be trimming one weldment body with a plane in a part file that has multiple structural members.
Have a look at IFeatManger.InsertWeldmentTrimFeature2 method.
I was simply using a weldment as an example, I need to use the split bodies command, and the issue I am having is that it wants to split all bodies, when I only need one body split.
ISplitBodyFeatureData.SetSplitBodies2 is the function you are looking for.
There is a Create Split-body Feature Example in the API help which shows you how to do it.
From the documentation on that method it isn't clear if that sets the target bodies or if that is for setting file paths, origins, and names for the resulting bodies. Could you clarify?
I've never used it. But the example I referred to shows you how to set the file names and paths for the resulting bodies.
I have adapted the macro to leave one body un-processed (see attached).
Thank you for posting an example, but unfortunately this doesn't address the question I have been asking.
1) I am not trying to save out the split body.
2) This still selects all bodies within the target bodies area
I am trying to set the option for selected bodies for the feature scope (circled in red above).
Hmm, well I may have to look at other options, maybe using intersect instead of split?
Retrieving data ...