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

Select thread in drawing;

[ Edited ]

Hi All,

How to select thread in drawing module; when i ask it's information manually i we will get Arc(Silloute of a thread feature);

i have written code to select it with this information but not able to select it, any advice please!

 

Thanks;

FL

 

D:\Arun\GTAC\7278144\Soruce

Tag tThread = NXOpen.Tag.Null;
                UFUi.Mask[] mask_triples = new UFUi.Mask[5];
                mask_triples[0].object_type = UFConstants.UF_solid_silhouette_type;
                mask_triples[0].object_subtype = 0;
                mask_triples[0].solid_type = 1;

                mask_triples[1].object_type = UFConstants.UF_circle_type;
                mask_triples[1].object_subtype = UFConstants.UF_circle_open_subtype;
                mask_triples[1].solid_type = 1;
                mask_triples[2].object_type = UFConstants.UF_conic_type;
                mask_triples[2].solid_type = 1;
                mask_triples[2].object_subtype = 0;
                mask_triples[3].object_type = UFConstants.UF_spline_type;
                mask_triples[3].solid_type = 1;
                mask_triples[3].object_subtype = 0;
                mask_triples[4].object_type = UFConstants.UF_section_edge_type;
                mask_triples[4].solid_type = 1;
                mask_triples[4].object_subtype = 0;

                UFUi.SelectionOption opts = new UFUi.SelectionOption();
                opts.mask_triples = mask_triples;
                opts.num_mask_triples = 5;
                opts.scope = UFConstants.UF_UI_SEL_SCOPE_WORK_PART_AND_OCC;
                int nResp = 0;
                Tag tView = NXOpen.Tag.Null;
                double[] cursorLoc = new double[3];
                ufs.Ui.SelectSingle("", ref opts, out nResp, out tThread, cursorLoc, out tView);

2 REPLIES
Solution
Solution
Accepted by topic author FL
‎08-26-2015 04:32 AM

Re: Select thread in drawing;

 

I think you might want to change that first one from

 

          mask_triples[0].object_type = UFConstants.UF_solid_silhouette_type;
          mask_triples[0].object_subtype = 0;
          mask_triples[0].solid_type = 1;

to

          mask_triples[0].object_type = UFConstants.UF_solid_silhouette_type;
          mask_triples[0].object_subtype = 0;
          mask_triples[0].solid_type = 0;


#define UF_solid_silhouette_type                201
#define    UF_solid_silhouette_sl_subtype                   0  <==
#define    UF_solid_silhouette_uvhatch_subtype         1
#define    UF_vicurve_subtype                                     2

 

If that still doesn't work, add

 

    UF_solid_type, 0, UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE

Re: Select thread in drawing;

Thanks a lot; i got a clue to change the code; i modified code this way and it is working fine;

 

NXOpen.

 

Selection.MaskTriple[] mask_arry = new Selection.MaskTriple[6];

mask_arry[0].Type =

 

UFConstants.UF_solid_silhouette_type;

mask_arry[0].Subtype = 0;

mask_arry[0].SolidBodySubtype = 1;

mask_arry[1].Type =

 

UFConstants.UF_circle_type;

mask_arry[1].Subtype = 0;

mask_arry[1].SolidBodySubtype = 0;

mask_arry[2].Type =

 

UFConstants.UF_conic_type;

mask_arry[2].Subtype = 0;

mask_arry[2].SolidBodySubtype = 0;

mask_arry[3].Type =

 

UFConstants.UF_spline_type;

mask_arry[3].Subtype = 0;

mask_arry[3].SolidBodySubtype = 0;

mask_arry[4].Type =

 

UFConstants.UF_section_edge_type;

mask_arry[4].Subtype = 0;

mask_arry[4].SolidBodySubtype = 0;

mask_arry[5].Type =

 

UFConstants.UF_solid_type;

mask_arry[5].Subtype = 0;

mask_arry[5].SolidBodySubtype =

 

UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE;

theUI.SelectionManager.SelectTaggedObject(

 

"", "", Selection.SelectionScope.AnyInAssembly, Selection.SelectionAction.ClearAndEnableSpecific, false, false,

mask_arry,

 

out tObj, out SelPt);