InputPlugin, control if Navisworks select or not the part picked

InputPlugin, control if Navisworks select or not the part picked

alexisDVJML
Collaborator Collaborator
105 Views
2 Replies
Message 1 of 3

InputPlugin, control if Navisworks select or not the part picked

alexisDVJML
Collaborator
Collaborator

I have an InputPlugin that allows the user to drag the virtual objects our main plugin render.
To do so I override in our InputPlugin:
- MouseDown: start drag
- MouseDrag: update rendering the part if position of the mouse has changed
- MouseUp: end drag and save changes

Very powerful.

However I have an issue.
Seems Navisworks will handle the MouseDown if I return false and thus change the selection, as demonstrated when I return true on my MouseDown override.
What I would like to achieve is to NOT select the part below if the user drag the part, but still allow Navisworks to select the part if the user does not drag.
I tried to change the return values of MouseUp to achieve this but will no effect.

So I can either totally disable the selection if user drag my virtual part OR always select the part even if user just want to select it and not drag the virtual part.

Any suggestions?

PS: I could try to force Navisworks to select the part as part of my MouseUp bit I worry this could create some ugly deadlocks 😉

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes
Accepted solutions (1)
106 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @alexisDVJML ,

 

After checking with the Engineering team, I believe this will not be possible.


Your tool will need to function in the same way as the gizmos in Navisworks (i.e., the things used to move objects). For example, If you click on a gizmo and don't move the mouse, you still don't select the object underneath.


This approach works well because the gizmo parts are relatively small, and the cursor changes to a hand icon when hovering over them, making it clear that you’re interacting with the gizmo rather than the object underneath.


Therefore, we recommend following the same paradigm.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

alexisDVJML
Collaborator
Collaborator

Hi @naveen.kumar.t,

Thanks for reverting on this topic.
What you suggest is more or less what I implemented.


More exactly (but still a bit simplified)
1/ I return true in MouseDown when I want to handle the click, aka when the mouse position matches one of our "virtual" parts, and save mouse position.
So Navisworks does not handle this click itself

2/ In MouseUp, if the mouse has not moved and thus I have not handled a drag & drop of our "virtual" parts but still a part has been clicked I force Navisworks Application.ActiveDocument.CurrentSelection to this item.
A bit suboptimal but works fine.

Thanks again.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes