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?
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?
http://support.industrysoftware.automation.siemens...
www.nxjournaling.com
RE: Journal: get selected components?
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