prok20081
Computer
- Apr 22, 2022
- 4
Hello guys.
I wrote a code that, when a thread is selected, reads data from it (pitch, length, radius, etc.)
How can I make it so that when a thread is selected, the data is displayed on the windows form(on DataGridView)?
I wrote a code that, when a thread is selected, reads data from it (pitch, length, radius, etc.)
How can I make it so that when a thread is selected, the data is displayed on the windows form(on DataGridView)?
Code:
namespace library
{
public class Class1
{
private static Session theSession;
private static UI theUi;
private static UFSession theUFSession;
public static Form1 theProgram;
public static bool isDisposeCalled;
public static void Main(string[] args)
{
theSession = Session.GetSession();
theUi = UI.GetUI();
theUFSession = UFSession.GetUFSession();
isDisposeCalled = false;
var workPart = theSession.Parts.Work;
Point3d helpPoint;
TaggedObject thread;
Selection select = UI.GetUI().SelectionManager;
var responce = select.SelectTaggedObject("specify thread", "thread selection", Selection.SelectionScope.WorkPart, false, new Selection.SelectionType[] { Selection.SelectionType.Features }, out thread, out helpPoint);
NXOpen.Features.Feature featThread = thread as NXOpen.Features.Feature;
string ftype = featThread.FeatureType;
if (responce != Selection.Response.Cancel && featThread != null)
{
UFModl.SymbThreadData threadData = new UFModl.SymbThreadData();
theUFSession.Modl.AskSymbThreadParms(featThread.Tag, out threadData);
}
Form1 NF = new Form1(helpPoint);
NF.Show();
}
}
}