cancel
Showing results for 
Search instead for 
Did you mean: 

Reach from operation to related faces (face ID)

Siemens Creator Siemens Creator
Siemens Creator

NXOpen JAVA

 

Is there a API (or a way) to get from an operation to a face ID of the faces that related to it.

For example I have a FLOOR AND WALL operation and I want to reach to the face ID of the floor cut area.

 

Thanks,

Tal.

3 REPLIES

Re: Reach from operation to related faces (face ID)

Esteemed Contributor
Esteemed Contributor

From the operation get the floor object and from there get the entities of the floor.

It is best to record a journal of adding faces to the floor to get the methods involved in the process.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Reach from operation to related faces (face ID)

Valued Contributor
Valued Contributor

I'm trying to do something similar, but i cant get the journal to give me exactly what I need to reach my goal.

I'll very appreciate if someone could post the code here.

 

Thanks!

Re: Reach from operation to related faces (face ID)

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Each operation can have one or more types of geometry related to it. For example any planar operation has part geometry, check geometry and cut area geometry. You can get access to these geometry objects via the operations builder object. For example:

 

 CAM::Geometry*  pCutAreaGeometry = planarOperationBuilder->CutAreaGeometry();

 

A CAM::Geometry object contains a list (GeometryList) wich holds zero or more GeometrySet objects which you can access by index:

 

Cam::GeometrySet* pGeomSet = pCutAreaGeometry->GeometryList()->FindItem(0);

 

The GeometrySet provides functionality for managing (adding/removing/querying) geometry. For example to get the current geometry (assuming a single face was selected) you could use:

 

std::vector<NXOpen::TaggedObject *> vecGeom = pGeomSet ->ScCollector()->GetObjects();

if (!vecGeom.empty())

{

    Face* pSelectedFace = dynamic_cast<Face*>(vecGeom[0]);

}

 

Regards,

 

Hans Scheerder

Sr. Software Engineer