Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NXOpen Section view creation

Husky Dusky

Mechanical
Mar 12, 2025
1
Hello,

Being a newbie with NX programming and customization need some help here.

I'm trying to create a section view from a drawing and with help of Journal have the basic code. I'm trying to make it generic so that it can be run for any drawing in future.

I'm trying to replace the FindObject method from Journal code to User selection prompt but it doesnt allow us to select the drafting spline from the view.

Here is the code that I have currently. The extracted edge from the view (left view) looks like this

(Extracted Edge) EDGE * 120 REVOLVED(7) 11069 {(26,-61.9711424777695,-159)(11.8650408521507,0.1576547870641,-159)(26,61.9711424777695,-159) REVOLVED(7)},


And its Type = 9 and subtype= 0 (got this by using AskTypeAndSubtype method on the displayable object from the view).


I'm using the same filter on the UI prompt as

Code:
NXOpen.Selection.MaskTriple[] mask = new NXOpen.Selection.MaskTriple[1];
mask[0].Type = 9;
mask[0].Subtype = 0;


Selection.Response response = theUI.SelectionManager.SelectTaggedObject("Select a curve", "Select a curve", NXOpen.Selection.SelectionScope.AnyInAssembly, NXOpen.Selection.SelectionAction.ClearAndEnableSpecific, true, true, mask, out selectedObjects, out cursor);

But the curve is NOT selectable. Any help is appreciated.

Thanks.
 

Part and Inventory Search

Sponsor