Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

[ Edited ]

I'm cycling through a CAM part looking for Operations. The part has, among other operation types, PlanarMilling and SolidProfile3D operations. But there does not seem to be a way to tell which is which!

When we create these operations we use the following (standard NX CAM templates):

PlanarMilling:

  • Template type: mill_planar
  • Template subtype: planar_mill

SolidProfile3D:

  • Template type: mill_contour
  • Template subtype: solid_profile_3d

But when I record a journal of creating these operations they both use PlanarMillingBuilder and produce an operation of class PlanarMilling Man Surprised

 

So while I'm cycling through the operations in my code, I'd like to determine what operation type each one is.


Initially I thought I'd just be able to get the object type and subtype, but for both I get type=100 (UF_machining_operation_type) and subtype=110 (UF_mach_pocket_subtype).

 

I did consider getting the template type and subtype of the operations, and as long as they've been created from the default templates that would work. But sometimes users create their own template operations so they have a bunch of default stuff already set how they like it. In this case the template type and subtype is returned as their template part and template operation name respectively. So I can't guarantee what these will be called.


The only other thing I found that I might be able to use to tell them apart is by using a UF function

UF_PARAM_ask_required_params()

This returns an array of integers that define the index of the required parameters of a CAM operation. There are about 450 returned and there are 18 differences between the arrays from the 2 operation types that I could possibly check.

But this feels like a really crappy way to do it. Anyone got any better ideas?

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5
24 REPLIES

Re: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

[ Edited ]

The UF.UFObject.AskTypeAndSubtype method can be used here, the constants are in the UFConstants class, uf_types.h respectively.

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: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

Ha. I just edited my original message saying I'd already tried object type and subtype. They are the same Smiley Sad
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

[ Edited ]

Man MadMan MadMan MadMan MadMan MadMan MadMan MadMan MadMan Mad

I started implementing some code to check one of the unique required parameter indices only to find that on a test part it failed.

After investigating I found that if I create a Solid Profile 3D operation but do not select any geometry or set any cut parameters or anything, the list of required parameter indices is exactly the same as a Planar Milling operation!

 

So now I'm stuck. I can't see any way to tell these two apart!

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

Could you try the attached journal on two newly created operations and check if there is any difference in the output?

 

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: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

Hi Stephan,

I did something similar with some old C code I have that retrieves the parameter values.

Anyway, I create one each of these operation types and did not select any geometry or change any settings, just clicked OK on the oper dialog.

I then selected each one and ran your code. There were a number of differences, but only in the parameter values. I'm not sure any of them are useful.

I used AraxisMerge to compare them and from that I removed all the duplicated parameters, then printed a report of the results to a PDF. This is attached below and the 2 files that were used for the comparison (with the duplicates removed).

 

Any suggestions?

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

I would say the only way is to use the template subtype, but that is the name of the operation template, so it could be Hugo too Smiley Wink

 

From my point of view there seems no real reliable way to tell them apart.

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: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

Yea, the template subtype was one of my first thoughts, but of course, it could be anything in the real world.

One other idea is to check the wallGeometry() from the PlanarMillingBuilder. This is meaningless for a plain old PlanarMilling op, but essential for a SolidProfile3D op. Of course, there could be no walls selected, but the op will not generate if thats the case so...

 

NX must know the difference though because it configures the operation dialog differently (for instance the Walls selection is shown for SolidProfile3D, but not for plain old PlanarMilling). So I've opened an IR (7452390) to see if Siemens can provide some way of telling the difference.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

The dialog is configured in the template, so there is nothing NX needs to know, it just creates a copy of the template operation, which is a regular editable part file.

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: How can I tell the difference between CAM operations SolidProfile3D and PlanarMilling in code

Doh! Of course Man Embarassed

I think I need a holiday Man Tongue

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5