How to import a step file that determines the path through a shortcut key
All  1  2-5

Previous
Next
 From:  Michael Gibson
11236.2 In reply to 11236.1 
Hi c3g, you can set up a shortcut key that loads a specific file like this:

script:moi.geometryDatabase.open('e:\\test.step');

That will do the same as using File > Open, and it will show the "Save changes?" dialog if you have any unsaved changes. You can prevent that "Save changes?" dialog from showing by passing in an additional optional parameter like this:

script:moi.geometryDatabase.open('e:\\test.step', false);

If you want to add the contents of the file to the current model while keeping existing objects in place, (doing the same as File > Import instead of File > Open) use this instead:

script:moi.geometryDatabase.fileImport('e:\\test.step');

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

Previous
Next
 From:  c3g (LONG)
11236.3 In reply to 11236.2 
Hi, Michael.

Thank you very much for your answer, I have successfully solved this problem. But I also want to add ICONS to the command bar to DIY my moi 3d, which I think is very cool and practical. I'm going to add 2 ICONS here for import and export, as shown. I only know that I need to edit the SidePane.htm file, but I don't understand programming. I have tried several times and failed. Please help me, thank you very much.


Attachments:

  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
11236.4 In reply to 11236.3 
Hi c3g, yes to add buttons there you will need to edit SidePane.htm, and locate the section for "SubDTabContent" which looks like this:

code:
                    <div id="SubDTabContent">
					    <table style="width:100%">
						    <tr>
								<td><moi:CommandMenuButton icon="icons/SubDCreateIcon.png" menu="SubDCreateMenu.htm"><moi:Text textid="SubD create menu button"/></moi:CommandMenuButton></td>
								<td><moi:CommandButton style="visibility:hidden;">&nbsp;</moi:CommandButton></td>
								<td><moi:CommandButton style="visibility:hidden;">&nbsp;</moi:CommandButton></td>
								<td><moi:CommandButton style="visibility:hidden;">&nbsp;</moi:CommandButton></td>
				 		    </tr>
					    </table>
                    </div>


Edit it to be like this and place 64x64 pixel image files "STEPIn.png" and "STEPOut.png" inside the ui\icons folder:

code:
					<div id="SubDTabContent">
						<table style="width:100%">
							<tr>
								<td><moi:CommandMenuButton icon="icons/SubDCreateIcon.png" menu="SubDCreateMenu.htm"><moi:Text textid="SubD create menu button" /></moi:CommandMenuButton></td>
								<td><moi:CommandButton icon="icons/STEPIn.png" onclick="moi.geometryDatabase.open('e:\\test.step');">STEP In</moi:CommandButton></td>
								<td><moi:CommandButton icon="icons/STEPOut.png" onclick="moi.geometryDatabase.saveAs('e:\\test.step');">STEP Out</moi:CommandButton></td>
								<td><moi:CommandButton style="visibility:hidden;">&nbsp;</moi:CommandButton></td>
							</tr>
						</table>
					</div>


- 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
 From:  c3g (LONG)
11236.5 In reply to 11236.4 
Hi, Michael
Thank you very much. According to your guidance, I have successfully made the icon. I believe the moi 3d forum is definitely a place full of love, the people here are very warm and friendly, it is a great honor to meet you here.
  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