SplitFaceFeature in direct edit mode returns None

SplitFaceFeature in direct edit mode returns None

mcd8604
Enthusiast Enthusiast
593 Views
4 Replies
Message 1 of 5

SplitFaceFeature in direct edit mode returns None

mcd8604
Enthusiast
Enthusiast

I was really hoping that I would be able to grab the collection of faces from the SplitFaceFeature, but it always returns None/null in direct edit mode (a requirement of my current use case). The component.features.splitFaceFeatures remains empty as well. Is there any simple way to get the modified faces or the newly created edges resulting from a SplitFaceFeature?

 

Thanks,

 

Mike

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

mcd8604
Enthusiast
Enthusiast
Accepted solution

Actually, it wasn't as difficult as I thought it would be. I just create a list prior to the split and compare the entities from the body after the split:

 

edgesPrior = [edge for edge in body.edges]
.. split face code ..
edgesNew = [edge for edge in body.edges if edge not in edgesPrior]

 

I won't mark this as a solution for now in case someone has a better solution.

0 Likes
Message 3 of 5

j.han97
Advocate
Advocate

Hi @mcd8604 ,

 

The fact that all (or most) features called in direct edit mode do not return the respective Feature object is weird to me. Reading the documentation, it feels like they are actually supposed to return something instead of None.

 

Nonetheless, it is the state of the API now and we can only develop some workarounds (like what you have done here).

0 Likes
Message 4 of 5

mcd8604
Enthusiast
Enthusiast

Yea, it's unfortunate. My guess is that some or most of the features get disposed of at some point. Then, if a handle was returned through the API then it would become invalid at the time of disposal. That or it was already disposed and there is no handle to return, hence the None. I have no idea though, this is pure speculation.

0 Likes
Message 5 of 5

kandennti
Mentor
Mentor

Hi.

 

Running SplitFace in the GUI does not add the feature to the browser tree.

1.png

I assume the same is true for the API.

0 Likes