Showing results for 
Search instead for 
Do you mean 
Reply

Obtaining a datum plane to trim

[ Edited ]

Hello everyone!

 

I have Datum Plane features in my tree. I need to obtain them in order to use as a tool in trim operations. But I'm a bit stuck. I can filter out features by type "DATUM_PLANE", but trim operation required explicit Datum Plane type - and I failed to convert Feature to Datum Plane. I tried different ways, but nothing works. Can you please help?

7 REPLIES

Re: Obtaining a datum plane to trim

See NXOpen.Part.Datums for the datums collection and check the items if they are of type DatumPlaneFeature.

Have you tried to record a journal of the manual process to see what API methods are involved?

What is your current code?

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Obtaining a datum plane to trim

Journal was of no help, it just stated that I need a datum plane. But I have finally found a way to obtain it: I cast feature into DatumPlaneFeature type and then extract DatupPlane from it.

 

            DatumPlaneFeature dpf = (DatumPlaneFeature)trimPlanes[0];
            DatumPlane dp = dpf.DatumPlane;

 

Is it possible to loop through DatumPlaneFeatures from the beginning, rather than looping through all features and checking every one whether it is a datum plane?

feature.FeatureType.Equals("DATUM_PLANE")

 

 

 

Re: Obtaining a datum plane to trim

The Datums property of the NXOpen.Part object is the datums collection, which includes datum planes, datum axis and datum CSYSs, so you may cycle through that collection only.

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Obtaining a datum plane to trim

I tried, but I kept receiving type mismatch error. I tried the following: foreach (??? dat in workpart.datums). Could not find the correct type in place of ???.

Re: Obtaining a datum plane to trim

If you check the ToArray() method of the collection, you will see that it returns DisplayableObjects.

A look into the NXOpen API reference for the collection would also help Smiley Wink

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Obtaining a datum plane to trim

this may work, code is Python

workPart = self.theSession.Parts.Work

#a list in python is similar to an array in c++
datum_list=[]

for datum_plane in workPart:


     self.theLw.WriteLine("Datum plane is "+str(datum_plane.JournalIdentifier))
    
     datum_list.append(datum_plane.JournalIdentifier)

Re: Obtaining a datum plane to trim

And Displayable Object will have to be cast into DatumPlaneFeature type? No improvement over my way then.