clear all selections

Hy all together,

i have a maybe simple problem.

How can i clear all selections?

I tried it with theui.selectionmanager but dind`t get what i whant.

Can somebody help please.

Hagen

The journal tools do not provide much help when working with selections. The only journal currently on this site that works with selections is:
http://nxjournaling.com/content/show-reference-set-objects

This journal will add all the objects in the specified reference set to a selection list. It will then allow the user to select additional objects or deselect existing objects. I'm not sure if this will help in your case, but I hope it will be of use.

Thanks for quick answer.

To select something is not the problem.
My problem is if something is selected and then user start my project (dll) it will also work with pre selected objects.

At the moment i ask selobjlist.


Dim sel As System.IntPtr = New System.IntPtr
Dim num_obj As Integer = 0
Dim bodystags As Tag() = Nothing
ufs.Ui.AskGlobalSelObjectList(num_obj, bodystags)

If num_obj > 0 Then
MsgBox("Something selected", MsgBoxStyle.Critical, "Auswahlfehler")
Me.Close()
End If

I tried to clear selectionlist but i cant find a way to get select_ As IntPtr because it was selected before start application.

So the user has to do it manuely.

Hagen

NX 9 and Team Center 10

It is not necessarily a bad thing that your code acts on pre-selected objects; this behavior mimics that of NX itself.

However, if you wish to ignore the already selected objects, there may be a way to deselect them. What objects should your code work with? Do you provide a selection mechanism for the user or does your code itself find the objects to work on?

My code works with bodies.
There are two ways to select them and the user can choose by selecting on form1.

The main problem is if bodies are pre selected the user then starts selecting an array of bodies. This is done by function using selecttaggedobjects.
If i start function (selection) the pre selected objects are within the list and they will be within the process.

So i need to clear this GlobalSelObjectList.

I thing my problem is undertsanding System.IntPtr and how to get this.

Hagen

NX 9 and Team Center 10

Plain journaling does not offer much help when working with selections. I would suggest contacting GTAC to see if they have a work-around and also to open an enhancement request (ER) asking for better tools to manage selected objects.

Thank you.

I will see what we can do. Open an ER will not be easy because there is no support for NX 9 any longer.

My solution is working but the user have to deselect manually.

If I will find a solution I will post it.

Thanks a lot Hagen

NX 9 and Team Center 10

Opening an ER on this topic should not be an issue as it also affects NX 10, and to the best of my knowledge, NX 11 as well. When/if you contact GTAC, have them add you to ER 1785948; this ER was opened some time ago asking for better API support for working with selections.

Ok this sounds good. I will forward it to our support team. They are in contact with Siemens and GTAC.
We will see how they react on this.
Sometimes not so easy.

NX 9 and Team Center 10