×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Problem making selections from NX UI Styler

Problem making selections from NX UI Styler

Problem making selections from NX UI Styler

(OP)
I am trying enable selection from a UI Styler dialog.  
 
When I created the dialog in NX, I had Selection "enabled", "Robust" selection type selected, "Single Position" checked, and Scope set to "Any in Assembly."
 
In the constructor for the dialog I have (among other non - related commands) the following lines of code to "wire up" the callbacks to NX:
 
Mask and Callback "Wireup":
 
selectionHandle = attributeeditorDialog.GetSelectionHandle()
Dim selectionMask_array(0) As NXOpen.Selection.MaskTriple
 
With selectionMask_array(0)
.Type = NXOpen.UF.UFConstants.UF_component_type
.Subtype = NXOpen.UF.UFConstants.UF_component_subtype
.SolidBodySubtype = NXOpen.UF.UFConstants.UF_UI_SEL_FEATURE_SOLID_BODY
End With
 
theUFSession.Ui.SetSelType(selectionHandle.Handle, UF.UFConstants.UF_UI_SEL_TYPE_ROBUST_SELECTION)
theUI.SelectionManager.SetSelectionMask(selectionHandle, Selection.SelectionAction.ClearAndEnableSpecific, selectionMask_array)
theUI.SelectionManager.SetSelectionCallbacks(selectionHandle, AddressOf filterSelected_cb, AddressOf selected_cb)
CallBack Functions:
Private Function selected_cb(ByVal SelectedObjects() As NXObject, _
                                           ByVal DeSelectedObjects() As NXObject, _
                                           ByVal SelectionHandle As SelectionHandle) As Integer
'nothing implemented yet
 
End Function
 
Private Function filterSelected_cb(ByVal NXObject As NXObject, _
                                                 ByVal MaskTriples As Selection.MaskTriple, _
                                                 ByVal SelectionHandle As SelectionHandle) As Integer
'nothing implemented yet
 
End Function
By the way, the "selectionHandle" variable is a module level variable.  
Here's the problem:
Both of the callbacks work as they should (as far as I can tell), but when I go to select a component in workspace, it:
1) does not hightlight the component - it acts as though my MaskTriple structure is incorrect - even though while running the program, it is using "Component" as the selection filter. The filterSelected_cb is triggered as I move the cursor over a component, passing in the component as NXObject.
2) passes NXobject arrays with a length of "0" (nothing in them) to the selection callback when the component is "picked" on - it acts as though it hadn't selected anything (the component is never highlighted).
The only thing that I could think to change is the Mask Type, Sub Type, and SolidBodySubType - but even then, I am using what worked before with other built in NX commands like UI.SelectionManager.SelectObjects(...).

By the way, I am running NX 5.0.6.3 in native.

Am I using these objects correctly?  Am I missing something?
Any help would be very much appreciated.

David Stockdale
Wagstaff, Inc.
Spokane Valley, WA 99216
(509) 922-1404 ext. 3261

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources