Need help with a script handler for interactiveViewChange('zoomarea')
All  1  2-5

Previous
Next
 From:  Michael Gibson
10403.2 In reply to 10403.1 
Hi Ed, unfortunately I don't think it is possible currently for a script to use interactiveViewChange() in this way.

The way view.interactiveViewChange() works currently is that it posts a message and then lets the current call stack unwind and doesn't start the view change loop until when the message is processed.

I will add in an optional 2nd parameter to interactiveViewChange() to make it go into its modal loop immediately rather than posting a message, so in v5 you will be able to do it like this without setting up your own event loop:

moi.ui.mainWindow.viewpanel.getViewport('3D').interactiveViewChange('zoomarea', true);

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  ed (EDDYF)
10403.3 In reply to 10403.2 
Thanks Michael - I'll use the Continue button for now.

Looking forward to Ver 5.

Ed Ferguson
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
10403.4 In reply to 10403.3 
Hi Ed,

Checking moi.majorVersionNumber might be helpful?

code:
    if ( moi.majorVersionNumber < 5) {
        moi.ui.mainWindow.viewpanel.getViewport('3D').interactiveViewChange('zoomarea');
	
	while (1)
	{	
	    moi.ui.commandDialog.waitForEvent();
	    
	    if ( moi.ui.commandDialog.event === 'continue' ) {
                return;
            }
	    
	}
    } else
        moi.ui.mainWindow.viewpanel.getViewport('3D').interactiveViewChange('zoomarea', true);


--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ed (EDDYF)
10403.5 In reply to 10403.4 
Good idea Larry - We'll do.

Ed Ferguson
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-5