Custom UI feature

 From:  dinos
8979.5 In reply to 8979.4 
Hi Tim,

really glad that you like my Script Palette!
Its a simple script that i wrote mainly to fit my workflow and so its not that flexible.

Having said that, it would be very easy to modify it to do what you want.

You just have to add you commands right after the Var declaration at the top of the script:
code:
		var line = '', title, cmd='', html = '', list = [],
			file = moi.filesystem.openFileStream( moi.settings.getIniPath(), 'r' );


in the following format:
code:
		var line = '', title, cmd='', html = '', list = [],
			file = moi.filesystem.openFileStream( moi.settings.getIniPath(), 'r' );
			
		list = [
			{ 'title' : "Volume Calculator", 'cmd' : "_CVolume2"},
			
			{ 'title' : "Naked Edges", 'cmd' : "script:var gd = moi.geometryDatabase; gd.deselectAll(); var breps = gd.getObjects().getBreps(); for ( var i = 0; i < breps.length; ++i ) breps.item(i).getNakedEdges().setProperty( 'selected', true );"}
		];
		
		


The list can contain any number of commands that you like and you can mix the commands here with any shortcuts that you selected using the original comment (/*! command name */) method.

If you are using an inline javascript command (javascript code that starts with the command script: like the Naked Edges command on top) then you have to make sure that the code contains no double quotes. If it does just change them to single quotes.

Please let me know if it works for you!

Best,

Dinos