×
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

Journal: get selected components?

Journal: get selected components?

Journal: get selected components?

(OP)
Hello all,

Is there a way to get a list of all currently selected components? I do not want a dialog or other interface asking the user to first select components like this:

Dim resp As Selection.Response = theUI.SelectionManager.SelectObject(prompt, "Selection", Selection.SelectionScope.AnyInAssembly, False, typeArray, selObj, cursor)

Instead, I want the code to immediately act upon components that are already selected. I couldn't find any information on this. Does anyone have a solution?

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000

RE: Journal: get selected components?

(OP)
Thanks, preselect was the keyword.

However, now I've run into another problem: how do I deselect the components? As far as I know you can remove the highlight of the components in the graphics window (comp.Unhighlight()), but this will not actually deselect the components. They will still be selected, as can be seen in the Assembly navigator, and any action performed will affect these components.

Doing a partCleanup1.DoCleanup() also won't deselect components.

I guess the correct way is with sel.RemoveFromSelectionList(), but you need a selection handle and I've no idea how to obtain this.

The only thing I could think of is to do a hack: sending an ESC key to the ugraf process with

If Process.GetProcessesByName("ugraf").Length >= 1 Then
For Each ObjProcess As Process In Process.GetProcessesByName("ugraf")
AppActivate(ObjProcess.Id)
SendKeys.SendWait(Keys.ESC)
Next
End If

but nothing happens. Any suggestions for deselecting components?

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000

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