×
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

Calling NX Selection Dialog from a WinForms Dialog

Calling NX Selection Dialog from a WinForms Dialog

Calling NX Selection Dialog from a WinForms Dialog

(OP)
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

RE: Calling NX Selection Dialog from a WinForms Dialog

(OP)
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??

RE: Calling NX Selection Dialog from a WinForms Dialog

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

RE: Calling NX Selection Dialog from a WinForms Dialog

(OP)
What is the "modeless" form? I haven't heard of that. Can you please explain?

Thank you.

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