script for naming per Style

Next
 From:  okapi
3565.1 
Hi Michael,
would it be possible to have a script to name all objects according to their Style name (as a 'one click' solution).
This would really speed up the export process.
Thanks,
  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
3565.2 In reply to 3565.1 
Hi okapi,

> would it be possible to have a script to name all objects
> according to their Style name (as a 'one click' solution).

Set up the following script on a keyboard shortcut for that:

script: /* Set object name as style name */ var objs = moi.geometryDatabase.getObjects(); var styles = moi.geometryDatabase.getObjectStyles(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); obj.name = styles.item(obj.styleIndex).name; }> This would really speed up the export process.

I'm curious why you want to do this for your exports?

Object names and style/material names are kind of separate things normally.

- 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:  okapi
3565.3 In reply to 3565.2 
Hi Michael,
thanks a lot.
Well, it is less useful if I am modeling in moi.
However I often get rhino files. In this case, when I just want to export through moi, the names from the layer structure out of rhino are normally sufficient.
  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