Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Application.run(Win_form) and spaceball

I'm trying to add a user interaction step into my NXOpen application.

It's a simple dailog to ask the user whether to flip face normals or not.

It displays a normal and a highlighted face however, there is no guarantee that the face shown is visible on screen.

As such I've used application.run to invoke the dialog so the user can interact with the NX session and twiddle the model around.  I'm using basic winforms and not block styler for this.

This is so close it's painful.  I can rotate the model with the mouse but everyone on site uses spaceballs which will not work while the dilog is active.

To add to this, as soon as you click on the NX screen area the dialog disappears behind it.

It's not quite a production solution.

Does anyone have advice on how to achieve interaction at this level?

 

Thanks as always.

 

Mark

12 REPLIES

Re: Application.run(Win_form) and spaceball

"there is no guarantee that the face shown is visible on screen."

 

You might consider using the WorkView.FitToObjects() method to make sure the entire object(s) is(are) in the view.

Re: Application.run(Win_form) and spaceball

Does the "fit to objects" also rotate the view so it is "in front"?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Application.run(Win_form) and spaceball

> Does the "fit to objects" also rotate the view so it is "in front"?

 

No, "Fit to Objects" doesn't do any view rotation.

山田
yamada

Re: Application.run(Win_form) and spaceball

[ Edited ]

"You might consider using the WorkView.FitToObjects() method to make sure the entire object(s) is(are) in the view"

 

As mentioned in other replies this only fits the view and there is still no guarantee that the face is visible.  It can be on the opther side of a solid and still not visible.

The other advantage on being able to rotate the view is that I'm trying to ask the users to orient a normal the correct way.  Rotating the view can help the user to correctly understand if the normal is already facing the correct direction or requires flipping.

Would using a block styler dialog allow the use of the spaceball?

I'm not ruling it out, I just prefer the flexibility of windows forms.

 

Thanks,

Re: Application.run(Win_form) and spaceball

> Would using a block styler dialog allow the use of the spaceball?

 

Generally, block-based dialogs allow view rotations while they are displayed. But I can't swear that rotation via Spaceball will work, because I don't have one. I'd guess that it would, but someone who owns one will have to confirm.

 

Terminology nitpicking:

Block Styler isn't really the point, using a block-based dialog is the point.

And there are several ways to create block-based dialogs

(1) Using Block Styler plus an NXOpen.BlockStyler.BlockDialog object

(2) Using Block Styler plus a Snap.UI.BlockDialog object

(3) Using a Snap.UI.BlockForm object

(4) Using the KF UIComp classes

The first two require Block Styler (or some very creative XML tricks); the last two don't.

山田
yamada

Re: Application.run(Win_form) and spaceball

Yamada,

 

Thanks for your all your help so far.  I'm keen to try a stlyer dialog to see if this is a solution.

Could you post an example of fully declaring the blockdialog for option (1)?

 

specifically a line specifying which dlx file to use?

 

Regards,

 

Mark

 

 

 

 

 

Re: Application.run(Win_form) and spaceball


Ken_A wrote:

Does the "fit to objects" also rotate the view so it is "in front"?


By itself, no. But it is an easy way to ensure that it is onscreen. It wouldn't be too difficult to hide the other bodies in the file (any bodies that do NOT contain the face) then rotate the view to the face in question. The API gives you pretty good control over the view orientation.

Re: Application.run(Win_form) and spaceball

Just to close the loop.

 

I persevered with a Block Dialog and used the .vb output that it created for me, using the Block UI Styler in NX.

This creates a class for the Block Dialog which I copied into my current Visual Studio Project.

 

This results in a dialog that remains on screen when the user interacts with the mouse and allows the nx session to still be controlled with the spaceball.

If anyone knows of a way to do this with winforms I'd still love to find out. 

Before anyone suggests it remoting is not an option Smiley Tongue

 

Thanks for all of your help Smiley Very Happy

 

 

 

 

Re: Application.run(Win_form) and spaceball

I've not tried it, but I suspect that a modeless form with NX set as the parent and its .TopMost property set to True may get what you want.