NX Journal Selection Priority
NX Journal Selection Priority
(OP)
I'm creating a journal using basic selection, and using this as a guide. I'm running into a sort of strange issue.
Using normal selection in NX, with no selection filters, the priority starts with components. I click on a body in an assembly, and the component is what's selected. But when I run the journal using the same selection technique from the tutorial, the selection priority starts with the solid body within the desired component. Now I may or may not have write access to that, and even if I did, I wouldn't want to dig into every component in the selection So is there a way of changing the selection priority within a journal to grab components as a whole and not trying to grab the child body?
Using normal selection in NX, with no selection filters, the priority starts with components. I click on a body in an assembly, and the component is what's selected. But when I run the journal using the same selection technique from the tutorial, the selection priority starts with the solid body within the desired component. Now I may or may not have write access to that, and even if I did, I wouldn't want to dig into every component in the selection So is there a way of changing the selection priority within a journal to grab components as a whole and not trying to grab the child body?





RE: NX Journal Selection Priority
If you want to set the selection to automatically filter for components, you should use the version of the select object function that allows you to set up a "mask triple".
http://nxjournaling.com/?q=content/using-mask-trip...
For a component the mask triple values are:
CODE
www.nxjournaling.com
RE: NX Journal Selection Priority
RE: NX Journal Selection Priority
CODE
Dim selectionMask_array(1) As Selection.MaskTriple With selectionMask_array(0) .Type = UFConstants.UF_component_type .Subtype = UFConstants.UF_component_subtype .SolidBodySubtype = 0 End With With selectionMask_array(1) .Type = UFConstants.UF_solid_type .Subtype = 0 .SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY End WithHowever, when run in an assembly, selection priority will kick in and it is up to the user to make sure they are selecting a component instead of a body (or vice versa).
www.nxjournaling.com
RE: NX Journal Selection Priority
Is there a standard NX default that has to be set, or does the SelectObject method in NXOpen not inherit selection priority from the current session?
RE: NX Journal Selection Priority
RE: NX Journal Selection Priority
RE: NX Journal Selection Priority
For example: if your selection filter is set to none and the selection priority is set to edges, as you move the cursor over the model edges within the selection ball will highlight. If there are no edges within the selection ball, some other object type will highlight. If you pull up the selection list, any available edges will be at the top of the list; other object types will be lower in the list.
www.nxjournaling.com
RE: NX Journal Selection Priority
RE: NX Journal Selection Priority
You may be able to do some custom filtering of your own...
The code below filters the selection for solid bodies. If the chosen body is an occurrence, the owning component is returned rather than the body itself.
CODE
Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Module Module1 Sub Main() Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim mySelection As TaggedObject If SelectObject("select a solid", mySelection) = Selection.Response.Cancel Then Exit Sub End If MsgBox("selection is a: " & mySelection.GetType.ToString) End Sub Function SelectObject(ByVal prompt As String, ByRef selObj As TaggedObject) As Selection.Response Dim theUI As UI = UI.GetUI Dim title As String = "Select an object" Dim includeFeatures As Boolean = False Dim keepHighlighted As Boolean = False Dim selAction As Selection.SelectionAction = Selection.SelectionAction.ClearAndEnableSpecific Dim cursor As Point3d Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly Dim selectionMask_array(0) As Selection.MaskTriple With selectionMask_array(0) .Type = UFConstants.UF_solid_type .SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_BODY End With Dim resp As Selection.Response = theUI.SelectionManager.SelectTaggedObject(prompt, _ title, scope, selAction, _ includeFeatures, keepHighlighted, selectionMask_array, _ selobj, cursor) If resp = Selection.Response.ObjectSelected OrElse resp = Selection.Response.ObjectSelectedByName Then Dim selBody As Body = selObj If selBody.IsOccurrence Then selObj = selBody.OwningComponent End If Return Selection.Response.Ok Else Return Selection.Response.Cancel End If End Function Public Function GetUnloadOption(ByVal dummy As String) As Integer 'Unloads the image when the NX session terminates GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination End Function End Modulewww.nxjournaling.com