shortcut for enable history
All  1  2-4

Previous
Next
 From:  Michael Gibson
6615.2 In reply to 6615.1 
Hi nos, this script should enable history updates on the selected objects:

script: /* Enable history updates on selected objects */ moi.geometryDatabase.getSelectedObjects().setProperty( 'updateWithHistory', true );

- 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:  noskule
6615.3 In reply to 6615.2 
Hi Michael
I tried to modify it that it would switch the status /true/false instead of just set it to true, but it dosnt work, do you see what Im doing wrong?

script: if ( moi.geometryDatabase.getSelectedObjects().updateWithHistory != 'true' ) { moi.geometryDatabase.getSelectedObjects().setProperty( 'updateWithHistory', true ) } else { moi.geometryDatabase.getSelectedObjects().setProperty( 'updateWithHistory', false ) };

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
 From:  Michael Gibson
6615.4 In reply to 6615.3 
Hi nos, the problem there is: moi.geometryDatabase.getSelectedObjects().updateWithHistory won't work because getSelectedObjects() returns an object list, not just a single object. It's a single object that will have the updateWithHistory property on it, not an object list.

Try this one:

script: /* Toggle history update property on selected objects */ var objs = moi.geometryDatabase.getSelectedObjects(); if ( objs.length > 0 ) { var val = objs.item(0).updateWithHistory; objs.setProperty( 'updateWithHistory', !val ); }

- 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

 

 
 
Show messages: All  1  2-4