Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Calling NX Selection Dialog from a WinForms Dialog

Status
Not open for further replies.

EngProgrammer

Aerospace
Joined
Jan 14, 2015
Messages
150
Location
US
Dear Forum,

I am trying to call an NXOpen dialog from a winForms dialog. Instead of using block styler, I am using WinForms. The code opens the winForms and then I've connected the following below selection dialog to the button on the winForms. But, the code hangs and freezes ug and doesn't allow any selection. I am thinking that I either to pass in the uf session and / or the workpart.

Function SelectSheet(ByVal prompt As String) As Face

Dim theUI As UI = UI.GetUI
Dim message As String = prompt
Dim title As String = "Selection"

Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart
Dim keepHighlighted As Boolean = False
Dim includeFeatures As Boolean = True

Dim selectionAction As Selection.SelectionAction = _
Selection.SelectionAction.ClearAndEnableSpecific

Dim selectionMask_array(0) As Selection.MaskTriple
With selectionMask_array(0)
.Type = UFConstants.UF_face_type
.Subtype = 0
.SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_SHEET_BODY
End With

Dim selectedObject As NXObject = Nothing
Dim cursor As Point3d

theUI.SelectionManager.SelectTaggedObject(message, title, scope, _
selectionAction, includeFeatures, _
keepHighlighted, selectionMask_array, _
selectedObject, cursor)

Dim oSheet As Face = CType(selectedObject, Face)

If oSheet Is Nothing Then
Return Nothing
End If

Return oSheet

End Function
 
You will need to close the win form before you can interact with NX. I posted a small demo journal a while back, you can find it in thread561-379287.

www.nxjournaling.com
 
I was afraid of that. I want to keep the winForms UI window open. I didn't want to use UI block styler. Have any other suggestions??
 
If you have an author license, you can use a "modeless" form which will stay open while you interact with NX. This type of form brings its own set of problems along, though.

Why do you need to keep the form open? Why not close it while the user makes a selection then re-open it? My preference, as a user of NX, is to only see one dialog open at any given time. An external form visible and potentially in the way could be annoying while attempting to make selection(s) in NX. </my2cents>

www.nxjournaling.com
 
What is the "modeless" form? I haven't heard of that. Can you please explain?

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top