Combine Feature not returned

Combine Feature not returned

j.han97
Advocate Advocate
557 Views
4 Replies
Message 1 of 5

Combine Feature not returned

j.han97
Advocate
Advocate

Hi all,

 

I have noticed something weird (to me) with the API. While using Combine feature to cut bodies, there is nothing returned. I.e.,

combineFeature = combineFeatures.add(combineFeatureInput)

The combineFeature is null in this case.

 

I went to read the documentations, and it explicitly stated that "This function returns nothing in the case where the feature is non-parametric". What is the reason of this behavior? I have used some other Features as well (PatchFeatures, etc) and there is no such issue.

 

I actually expected to obtain the bodies after the cut, and if combineFeature was not returned, how should I determine which bodies are resulted from this operation? 

0 Likes
Accepted solutions (1)
558 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

Notice that when you create a Combine feature when Fusion is in direct modeling mode that there isn't a combine feature shown in the browser. As a result, there's nothing to return.  Even in cases when there is a feature in the browser, they're "fake" features in that they don't remember all of the information that was used to create it. Instead, they act as a way of grouping the faces that were created by that feature.

 

In your case, I think you can probably get what you need by getting the bodies before and after and can assume all the new bodies were created by the Combine feature.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 5

j.han97
Advocate
Advocate

Hi @BrianEkins ,

 

Thanks for your advice. Considering the potential number of bodies, I was worried about the impact on performance if I compare the bodies before and after. Currently I just switch to parametric modelling temporarily and perform the cut action, collect the resulting bodies in a list and switch back to direct modelling.

 

I noticed that switching the modelling environment did produce some lag as well, so I will compare these two methods before actual decision.

 

Alternatively, if NewComponentFeatureOperation is selected for CombineFeatureInput, is it possible to specify/obtain the new component created? This way the resulting bodies have to be in the new component, which makes it easier to get them.

0 Likes
Message 4 of 5

BrianEkins
Mentor
Mentor
Accepted solution

I think you should be able to count on getting the last occurrence in the occurrences collection and then getting the component from it. I would use the Occurrences.asArray method since that is guaranteed to return the occurrences in the same order as they appear in the browser. I didn't test it, so hopefully that all works when in direct modeling mode.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 5 of 5

j.han97
Advocate
Advocate

Thanks @BrianEkins , this might be the easiest approach under such conditions. I have done a simple test (under static list) and it worked well. Might need to further test it during dynamic changes (add/remove occurrences, etc). 

0 Likes