Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX Journal - Masking for Edge

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
I'm trying to learn by example how to do some journalling. I found an NX code snippet to filter a selection to curves only, but I want to modify it to filter by edges. Where can I find a good explanation of how NX parses this and how to make changes?
Code:
Function mask_for_curve(ByVal select_ As IntPtr, ByVal userdata As IntPtr) As Integer

        Dim num_triples As Integer = 5
        Dim mask_triples(4) As UFUi.Mask

        mask_triples(0).object_type = UFConstants.UF_line_type
        mask_triples(0).object_subtype = 0
        mask_triples(0).solid_type = 0

        mask_triples(1).object_type = UFConstants.UF_circle_type
        mask_triples(1).object_subtype = 0
        mask_triples(1).solid_type = 0

        mask_triples(2).object_type = UFConstants.UF_conic_type
        mask_triples(2).object_subtype = 0
        mask_triples(2).solid_type = 0

        mask_triples(3).object_type = UFConstants.UF_spline_type
        mask_triples(3).object_subtype = 0
        mask_triples(3).solid_type = 0

        mask_triples(4).object_type = UFConstants.UF_point_type
        mask_triples(4).object_subtype = 0
        mask_triples(4).solid_type = 0

        ufs.Ui.SetSelMask(select_, _
                           UFUi.SelMaskAction.SelMaskClearAndEnableSpecific, num_triples, mask_triples)
        Return UFConstants.UF_UI_SEL_SUCCESS

    End Function
Thanks,
Jeff
 
Replies continue below

Recommended for you

Nevermind, I just realized I could add:

Code:
mask_triples(5).object_type = UFConstants.UF_solid_type  
mask_triples(5).object_subtype = 0  
mask_triples(5).solid_type = UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE

I'm good now.

Thanks,
Jeff
 
If you add that code to the existing code, also change
Code:
Dim num_triples As Integer = [COLOR=red]6[/color]
Dim mask_triples([COLOR=red]5[/color]) As UFUi.Mask

The change you made will filter for curves, points, or edges; if you want just edges, delete the filters for curves and points and change the dim statements to:
Code:
Dim num_triples As Integer = [COLOR=red]1[/color]
Dim mask_triples([COLOR=red]0[/color]) As UFUi.Mask
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor