Export Script

Next
 From:  Crusoe the Painter (CRUSOE)
3025.1 
Anyone have a script that can export selected components of a model automatically?

I'd like to select models, and have a script export each piece in turn. As it is, I have to go through it one at a time.
  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
3025.2 In reply to 3025.1 
Hi Crusoe - I may need a bit more information from you to fully understand - do you mean exporting the selected objects to a fixed file name when you push a shortcut key?

That is possible by setting up the following as the command on a keyboard shortcut:

script:moi.geometryDatabase.fileExport( 'c:\\test.3dm' );


Note that in a script the \ character is used as an escape (for things like \r meaning return), so you must put \\ inside of a script's string value to make an actual \ character in the string's value.


With that in place, you can push that shortcut key to export selected objects to the file c:\test.3dm

- 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:  Crusoe the Painter (CRUSOE)
3025.3 In reply to 3025.2 
Lets say I name every object something, I'd like to hit a button, "export all" (or maybe all visible), chose the filetype, and have it save each named group to a different file with the group name as part of the filename. If a object is not named, it could go in a file called "object_1", "object_2" etc.
  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
3025.4 In reply to 3025.3 
Hi Crusoe, I think I get the idea and scripting something along those lines should be possible.

Still need a few details to be cleared up though -


> I'd like to hit a button, "export all" (or maybe all visible)

Which one, everything or skip hidden objects?


> chose the filetype

This part is probably a bit difficult since there is not any kind of "filetype" picker set up, only things to get a full file name. So probably the script would have a fixed file type associated with it and you could edit the script to control the file type.


> and have it save each named group to a different file with
> the group name as part of the filename.

Into which folder would you want the files saved to?

Files don't normally just get created on the computer with a single simple isolated name, they need to go into a folder somewhere.

Or do you mean that the object names will include a full path with a folder name in it?

- 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:  Michael Gibson
3025.5 In reply to 3025.3 
Hi Crusoe - also are you going to be exporting to a mesh file format?

By default the meshing dialog will be shown on every separate export when going to a mesh format.

Is that what you want, or do you want to have some fixed settings specified in the script which will get used and no mesh dialog shown? That's the other possibility.

- 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