auto naming function
All  1-8  9-13

Previous
Next
 From:  noskule
5701.9 In reply to 5701.8 
Yes its always the last object. So if the script would find the object automatically its even better. So I only could perform a construction command, press the shortcut and the newly created object gets the name of the construction elements striped from the ending.
~nos
  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:  noskule
5701.10 In reply to 5701.6 
hi Michael
I tried the scripts and as you mentioned they working as long a the history is intact. Is there a reason for using the history instead of searching for the names? Cause searching for names with/without the ".CE" Ending would work interdependently form an intact history.
~nos
  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
5701.11 In reply to 5701.10 
Hi nos,

> Is there a reason for using the history instead of searching for the names?

Because history is the only built in mechanism that matched what you were asking for.

Could you describe in a bit more detail exactly what names would be targeted? I guess I need more details about what you need these scripts to do - the brief descriptions you gave before did not give me enough information to do what I guess you need.

- 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:  Michael Gibson
5701.12 In reply to 5701.9 
Hi nos,

> Yes its always the last object. So if the script would find the object automatically its even better.
> So I only could perform a construction command, press the shortcut and the newly created object
> gets the name of the construction elements striped from the ending.

Give this one a try:

script: /* Apply selected object name to last generated object */ var name = ''; var gd = moi.geometryDatabase; var objs = gd.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var thisname = obj.name; if ( thisname.length > 3 && thisname.charAt(thisname.length-3) == '.' ) { name = thisname.substr( 0, thisname.length-3 ); break; } } if ( name != '' ) { gd.selectLastCreated( true ); gd.getSelectedObjects().setProperty( 'name', name ); }


This way this should work is say you a profile and a path curve both named Pipe.CE. Then you create a sweep from these curves - now with those curves selected, run this script and that should then make the sweep have the name Pipe, it will just look for a name in the current selection with a period and any 2 letters after it and if it finds that it will name the last generated object to be that name with the last 3 letters stripped off.

- 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:  noskule
5701.13 In reply to 5701.12 
Hi Michael, thanks ver y much, this works perferctly.
~nos
  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-8  9-13