I am new to NX Open journals and coding in general, and I have tried to accomplish something with studying, but now I am in need of some guidance.
I want to add code that will label these curves that it has found as just "Curve 1", "Curve 2", "Curve 3" , ... etc... on the actual Math model. How can I achieve this?
Something similar to an outcome of what I want is:
So far, I wrote the code of identifying the curves and counting how many total curves there are:
using NXOpen;
using NXOpenUI;
using System;
internal static partial class NXJournal
{
public static void Main (){
Session theSession = Session.GetSession();
Part workpart = theSession.Parts.Work;
int numCurve = 0;
foreach (NXOpen.Curve cur in workpart.Curves) // Code for finding the facet bodies
{
numCurve = numCurve + 1; // Counting how many in layer # with color #
// Put labeling code here
}
// Then it will repeat
Guide.InfoWriteLine("This analysis has" + numCurve + ".");
}
}
However, this code only adds up a total amount of curves and does not label them on the math model.
In the code add where you are doing the foreach loop, just assign names to the curves.