Exploration of Scripting in MOI
All  1-4  5-8

Previous
Next
 From:  Michael Gibson
9490.5 In reply to 9490.4 
Hi Dave, for select all try:

moi.geometryDatabase.selectAll();

If you want to do something that is in the regular UI you can look in the .htm files in the UI subfolder to see what it's doing. Most stuff is in SidePane.htm so for example if you search in there for "SelectAll" that would take you to a button with with some script on it's onclick="" handler with the above code in it.

Also if you have your code above in its own .js file you can leave off the "script:" parts in front, that's something that you can put in the start of a shortcut key definition to tell the shortcut key processor that it's a chunk of script code in the shortcut key instead of a command name.

- 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:  3d2cnc
9490.6 In reply to 9490.5 
Hi Michael,

That information was very useful. Thank-you so much.

Have setup hotkeys for the scripts that are working thus far.



Unsuccessfully trying to Imitate your " Include Edge Option " in the Silhouette Script.

Currently cannot get the objects edges silhouette to happen correctly.

Hoping to avoid using the sidepane silhouette icon and having to select "Include edges" checkbox.

Looking for easier solution to script that "Include Edge Option" .

Any tips on what steps to take?

P.S.
Moi has been great for designing structures. "Quickly". Although I haven't used it for any piping designs as of yet, but it looks like a snap.

Dave
Image Attachments:
Size: 1009.5 KB, Downloaded: 41 times, Dimensions: 1364x807px
  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:  3d2cnc
9490.7 In reply to 9490.6 
So far coming out of this endeavor to create this proposed script is...

Combining the freehand from two axis planes, loft and use this

well, create a terrain map on an object?
Attachments:

Image Attachments:
Size: 356.2 KB, Downloaded: 28 times, Dimensions: 806x709px
Size: 428.6 KB, Downloaded: 19 times, Dimensions: 859x745px
  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:  Michael Gibson
9490.8 In reply to 9490.6 
Hi Dave, that's great that you're making good progress!

So for include edges the way to figure out how to replicate that in a script is to first look at the Silhouette.htm file and find the "Include edges" button which is this:

code:
<moi:CheckButton id="includeedges"><moi:Text textid="Include edges checkbox"/></moi:CheckButton>


The key thing that you're looking for is the id value. So then go to the Silhouette command script file (Silhouette.js) and search for includeedges, which is this:

code:
ui.bindUIToInput( 'includeedges', 'value', factory.getInput(4) );


So what the regular command is doing there is making a link between the includeedges checkbox UI controls's value property and the silhouette factory's input with index 4.

In your script you'd want to do something like factory.setInput( 4, true ); to turn it on.

Some UI will set up a binding like that and others will look for a UI event of that id value being triggered if they need to do other stuff in addition to just setting a value on the factory.

Hope that helps!

- 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
 

Reply to All Reply to All

 

 
 
Show messages: All  1-4  5-8