Showing results for 
Search instead for 
Do you mean 
Reply

Set Color Method using Open NX

Dear expert,

 

As I mention in title that right now I am creating a small application for recognizing machining features. I would like to set some colors for recognized features. Thus, I found UFObj.SetColor()method from API NX Open. However, I do not understand what kind of object that should be assigned for this method.

 

For your information, I observe a machining feature by collecting faces according to certain rules. Then, the faces are extracted by Modl.AskBodyFaces() method and evaluated based on relationship between the faces and its adjacent faces. After that, I hope I can change face color  according to type of features. Recently, I tried to use "Face ID" that I got from AskBodyFaces method but it does not work properly.

 

What I need is an explanation in detail on the object type that can be used for "SetColor" method. Moreover, I would be very grateful if you can show me some examples.

 

Best regards,

Riona Ihsan Media

CAD/CAM Learner

2 REPLIES

Re: Set Color Method using Open NX

If you want to change the color of certain face objects, you will be better off using a DisplayModification object rather than the .SetColor function. Start the journal recorder and use the Edit -> object display command to change the color of a few faces; the recorded code should show you what you need to know.

Re: Set Color Method using Open NX

The function NXOpen.UF.UFModl.AskBodyFaces returns an array of tags of faces in the body. You should be able to take each of these tags (one at a time) and pass it into NXOpen.UF.UFObj.SetColor.

 

If that doesn't work, your problem lies elsewhere.

 

Why don't you show us the relevant portion of your code?

山田
yamada