Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Outputting Thread Data to a Windows Form

Status
Not open for further replies.

prok20081

Computer
Apr 22, 2022
4
0
0
RU
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)?
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();
        }



    }
}
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top