Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NXJournal-select feature on drawing (filtr)

MANox

Mechanical
Apr 2, 2007
130
Hello everyone,

I try to write journal with uses Hole and Thread Callout and I have some problem:
When I use it I NX filtr have value: Feature (red elipse):
1739563272619.png

And I can select every feature (if part is Full Load).
But when I try use journal with Fuction UserSelectFeature( and filtr "UF_feature_type") it's doesn't work because this filtr is only for modeling.
And I can't find any other filter for select feature in drawing.

ASP.net:
    Function UserSelectFeature(ByVal prompt As String, ByRef theView As Tag, ByRef theObject As Tag) As Selection.Response
        'Allow user to interactively select an edge
        Dim response As Integer = 0
        Dim user_data As System.IntPtr
        Dim theCursor(2) As Double
        theUfSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM)
        Dim curCursorView As Integer
        theUfSession.Ui.AskCursorView(curCursorView)
        Try
            theUfSession.Ui.SetCursorView(0)
            'SelectWithSingleDialog allows the user to make a single selection and returns the object, the point and the view.
            theUfSession.Ui.SelectWithSingleDialog("Select component: ", prompt, UFConstants.UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY, AddressOf init_proc_body, user_data, response, theObject, theCursor, theView)
        Finally
            theUfSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM)
        End Try
        If Not theObject.Equals(Tag.Null) Then
            theUfSession.Disp.SetHighlight(theObject, 0)
        Else
            theUfSession.Ui.SetCursorView(curCursorView)
            Return Nothing
        End If
        Select Case response
            Case UFConstants.UF_UI_BACK
                Return Selection.Response.Back
            Case UFConstants.UF_UI_OK
                Return Selection.Response.Ok
            Case UFConstants.UF_UI_OBJECT_SELECTED
                Return Selection.Response.ObjectSelected
            Case UFConstants.UF_UI_OBJECT_SELECTED_BY_NAME
                Return Selection.Response.ObjectSelectedByName
            Case Else
                Return Selection.Response.Cancel
        End Select
    End Function


    Public Function init_proc_body(ByVal select_ As IntPtr,
                             ByVal userdata As IntPtr) As Integer
        'this function must have the same signature as UFUi.SelInitFnT Delegate
        Dim num_triples As Integer = 1
        Dim mask_triples(num_triples - 1) As UFUi.Mask
        mask_triples(0).object_type = UFConstants.UF_feature_type
        mask_triples(0).object_subtype = UFConstants.UF_all_subtype
        theUfSession.Ui.SetSelMask(select_, UFUi.SelMaskAction.SelMaskClearAndEnableSpecific, num_triples, mask_triples)
        Return UFConstants.UF_UI_SEL_SUCCESS
    End Function

Is it exist?

Best regards
MANok
TC2412
NX2406
 

Part and Inventory Search

Sponsor