cancel
Showing results for 
Search instead for 
Did you mean: 

Losing Face Names at Split/Divide/Subtract operations

Hi,

 

I have a problem with face names.  When a face has name (Face.Name) or custom attributes, and that face is split up by any operation (DivideFace, SplitBody, Subtract...), only one of the face fragments keeps the name and attributes. This also goes for color, even though my Modeling Preferences "display properties for new geometry" are set to parent body.

 

I want to rename the faces.

 

I have a ton of options for simple cases, but the cleanest way for arbitrary cases I could think of would be either

 

  • some attribute that remains at splitting (haven't found anything yet)

 

  • or comparing the resulting faces to the original faces.

 

I have scripted something that suppresses the (e.g.) divide face, opens a builder on it, gets the original faces, creates non-assovciative, timestamp fixed extract faces, unsuppresses and compares these to the (unsuppressed again) resultant faces. However, it turns out that sometimes when suppressing the divide face, the whole-again faces have an empty name field (and custom attributes). Back to square one.

 

Now it seems that the color attribute works properly on the face when suppressing the divide. So I could color-code my faces according to unique name, split-divide-subract... , then run my supressing routine and then reset the names according to unique color. But that would require running that coloring routine before doing any splits, which is not really what I was going for, since I might get parts after they are already split.

 

Does anyone have any ideas? Am I missing something obvious, like a "keep names" setting?

 

Thanks a lot,

Niko

 

(Version is NX 10.0.3.5 on Linux)

16 REPLIES

Re: Losing Face Names at Split/Divide/Subtract operations

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Use the C function UF_MODL_ask_split_face. It will give you, for a given face,  all the faces generated after split/divide/ etc., so you can rename them or retag them with attribute.

 

Cheers !

 

 

UF_MODL_ask_split_faces (view source)
 

Defined in: uf_modl.h
 
Overview
Returns all of the split faces of the given face. For occurrences input from
the face argument, the faces returned from the faces argument are on the
occurrence.
int UF_MODL_ask_split_faces
(
tag_t face,
int * nfaces,
tag_t * * faces
)

Re: Losing Face Names at Split/Divide/Subtract operations

Thanks for the great suggestion! That is a useful function.

 

It also exists in the python interface as NXOpen.UF.Modeling.AskSplitFaces().

 

Unfortunately, that was one of the things I tried, which works for simple cases but not for arbitrary cases.

 

That function has an elephants memory. It never forgets anything, and I did not find a way to fine tune that.

So it gives me way to many faces for each face I query. Every subtract in design history will be remembered (if I recall correctly even across assembly parts), even when I extract the geometry in between.

In complex cases, that makes it impossible to find the correct name out of many for a given face.

 

Do you know of a way to clear the memory of that function?

 

 

Re: Losing Face Names at Split/Divide/Subtract operations

Ok, I have a different algorithm now - still the complicated thing with suppressing the feature, extracting the faces, etc.

 

But of course, as long as one of the resultant faces keeps the name, I dont need the original face to have it. So that works so far.

 

It is however far from an elegant solution. 

Re: Losing Face Names at Split/Divide/Subtract operations

Esteemed Contributor
Esteemed Contributor

Have you tried UF_MODL_ask_feat_faces() (or common API equivalents)?

Find all the split features.

Find the faces of those feature(s).

I'm assuming one of the faces would be the "original" (with names/etc.).

The other(s) would be the ones you want to assign the data to.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Losing Face Names at Split/Divide/Subtract operations

Yeah, I've tried that.

 

Unfortunately, this is another one of these methods that works if you do only a simple split on one face with one name. The operations I'm looking at are a bit more unwieldy.

 

e.g. one of them is dividing 38 faces on 1089 objects. In one feature. So there are a ton of faces with a ton of different names left after the split. Pairing the unnamed faces to the proper names in these cases is rather messy.

 

I think I'm getting there, but it is kind of tricky.

 

I have a routine for splitbody operations that pairs them by looking at the edges of the cuts. I have a routine for divide face operations that does this extract face thing (and then looks for the smallest containing face in the original geometry). I have noting yet for subtract operations. But it is all rather complex and I had hoped that someone might point me at some great function that I haven't found yet. 

Re: Losing Face Names at Split/Divide/Subtract operations

Esteemed Contributor
Esteemed Contributor

Another way of looking at this (not sure if would be any easier) - the UF_BREP_* functions.

Review the "tetrahedron" example. in the docs.

I think there is common API (and SNAP?) support for this now.

 

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Losing Face Names at Split/Divide/Subtract operations

I am confused. I found the documentation for BREP in C online and the mentioned example.

 

But I don't yet see what you meant. Getting at faces and edges is easy in the API. Are you suggesting to use that BREP tree instead of extracting the geometry?

 

 

 

Re: Losing Face Names at Split/Divide/Subtract operations

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

See a potential solution here

https://solutions.industrysoftware.automation.siemens.com/view.php?sort=desc&p=1&q=UF_MODL_ask_split...

 

Run once through the part and bookkeep all the split faces for all the faces of the body.

Then split.

Then bookkeep again.

 

Analyze the bookkeeping differences. This will give you exactly the faces that were split by your operation.

 

MAYAHTT
www.mayahtt.com

Re: Losing Face Names at Split/Divide/Subtract operations

Ah, and because the one face that retains the name also retains the identity, the pairing between pre-split and after-split is possible. Very neat!

 

If that works together with suppressing the split, so that it can be applied to existing parts, it is perfect!

 

I'll let you know if that works, but thank you very much already!