Scripts to change view question

Next
 From:  fcwilt
11710.1 
Hi,

I have these scripts in my shortcut keys setup and they work fine:

script:var vname = '3D'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname;

script:var vname = 'front'; var vp = moi.ui.mainWindow.viewpanel; if ( vp.mode == vname ) vp.reverseView( vname ); else vp.mode = vname;

script:var vname = 'right'; var vp = moi.ui.mainWindow.viewpanel; if ( vp.mode == vname ) vp.reverseView( vname ); else vp.mode = vname;

script:var vname = 'top'; var vp = moi.ui.mainWindow.viewpanel; if ( vp.mode == vname ) vp.reverseView( vname ); else vp.mode = vname;

The last three toggle front/back, right/left and top/bottom.

My question: Is there a way to go straight to "back", "left" or "bottom"?

I have a 3D Connexion device which has buttons for "back", "left" and "bottom" but I cannot figure out the scripts for them.

Thanks.

Frederick
  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:  Michael Gibson
11710.2 In reply to 11710.1 
  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:  fcwilt
11710.3 In reply to 11710.2 
Hi Michael,

Yes, they work fine.

I don't exactly understand what they are doing but as long as the work.

Frederick

P.S. Do you have a PayPal account?
  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:  Michael Gibson
11710.4 In reply to 11710.3 
Hi Frederick,

re:
> P.S. Do you have a PayPal account?

Thanks, I appreciate it but its not necessary.

- 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:  fcwilt
11710.5 In reply to 11710.4 
Hi Michael,

It would make me feel better - reciprocating in the only way I can.

Frederick
  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:  Michael Gibson
11710.6 In reply to 11710.5 
Hi Frederick, it's always cool to see pics of stuff that people are working on.

Thanks,
- 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:  fcwilt
11710.7 In reply to 11710.6 
Hi Michael,

That I can do but it's nothing artistic, simple low-budget engineering finding ways to turn simple 3D printer parts into something useful.

Here is a recent project that is proving to be somewhat difficult to find the best solution.

But it can help explain why I found being able to save/restore sets of "not hidden" objects.

One of my MoI project files will likely contain a few different versions of the various sub-assemblies, each version using different versions of individual parts.

Now that I can create (or soon will be) different saved sets of visible objects, I can easily view a given version of a sub-assembly, without the pain of showing/hiding object by object.

I cleaned up my code that was unnecessarily hiding sub-objects and the code works just fine.

What is missing is the UI to allow specifying some sort of unique identifier for each set, which would be used to create the key for the object-level user data.

I'm also thinking of finding a way to have one set of commands (save/restore/clear), that could be used from the same UI, for visible sets, selection sets and export sets.

I'm also looking forward to the next BETA where I hope to be able to turn the "working" cursor on and off. Right now the code goes to work and MoI appears dead, not very user friendly.

Frederick
Image Attachments:
Size: 244.9 KB, Downloaded: 28 times, Dimensions: 1022x911px
  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)
11710.8 In reply to 11710.7 
Hi Frederick,

I've been following your recent threads on scripting with interest. Noting your desire to reciprocate, a comment I would make is that the community that Michael has created along with MoI tends to share many of the scripts that get written either as examples or as functioning tools for others to make use of. In my view, MoI is something of a labor of love, unlike any other software I'm familiar with; I share your view that Michael's generosity of spirit is remarkable. The scripts we write provide something of an opportunity for us to give a little back. I for one would be interested in seeing and potentially using your "assembly" oriented scripts. The community convention for publishing scripts is via a thread on the forum & then as the script gets revised, the script thread's initial post (thread.1) gets updated so that there is a single spot to find the most recent version of a given script.

Since your scripts are using version-specific features, you might consider including something akin to:

code:
if ( moi.majorVersionNumber < 5)
    moi.ui.alert( 'Requires MoI version 5 or later');
else
    doScript();

Thanks also for sharing the image of the printer assembly, looks quite intriguing. I use MoI mainly to design things that I make using manual (non-CNC) machine tools.

--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
Next
 From:  fcwilt
11710.9 In reply to 11710.8 
Hi Larry,

I would be glad to share them, just need to get the UI part working.

I've found an example script that I believe can be adapted to my needs.

The part about checking the version is good advice - I will re-visit my code and include it.

Thanks.

Frederick
  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:  fcwilt
11710.10 In reply to 11710.8 
Hi Larry,

Here are the results of my conversations with Michael.

There 3 deal with sets of objects:

VisibleSets - which allows creating sets of objects based on their being visible at the time of set creation and later restoring the visibility of the objects in any given set while hiding those not in the set.

SelectionSets - which allows creating sets of objects based on their being selected at the time of set creation and later restoring the selection of the objects in any given set while de-selecting those not in the set.

ExportSets - works the same as SelectionSets with the added feature of being able to Export only those objects that are part of any given set. My version only exports STL because that is what I do most. But it could easily be modified to export a selected file type. The path for exporting is stored in the user data of the document.

This one is deals with Styles:

StyleOps - 1. allows deleting unused styles 2. allows merging styles of similar color and updating the objects that use the color that is being eliminated to use the color that remains. 3. Allows re-sequencing of styles that begin with "Level " so they are numbered from 1 to whatever with no gaps or repetition.

If of interest and you have questions feel free to ask.

Frederick

  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