Save the current "selection set" and restore later
All  1-7  8-9

Previous
Next
 From:  Michael Gibson
11708.8 In reply to 11708.6 
Hi Frederick, great I'm glad that does what you were needing.

re:
> I gather the ID of an object is not like a GUID that is unique and unchanging.
>

Actually the ID of an object is a unique GUID that doesn't change.

The issue is that it is tied to that specific version of the object. With any type of editing
(including transforms), the result of the edit will have it's own new unique ID value.


re:
> In your example code you used a command removeUserText.
>
> What other commands are there related to user text?

From:
http://moi3d.com/wiki/V5Beta#Mar-28-2023

Implement document user text for scripts
New document user text values so scripts can add data that is saved and restored from 3DM files.
New methods under moi.geometryDatabase:
.setUserText( Key, Value ); - Set text value for given key.
.getUserText( Key ); - Returns text value for given key, or undefined if not present.
.removeUserText( Key ); - Remove user text value for given key.
.getAllUserText(); - Return list of all user text, each object has .key and .value properties.
.clearAllUserText(); - Clear all document user text.

There is also now object user text available for scripts to store data on an object:
.setUserText( Key, Value ); - Set text value for given key.
.getUserText( Key ); - Returns text value for given key, or undefined if not present.
.removeUserText( Key ); - Remove user text value for given key.
.getAllUserText(); - Return list of all user text, each object has .key and .value properties.
.clearAllUserText(); - Clear all object user text.

Document user text can also be viewed and edited under File > Notes > "Document user text" button and object user text will show on the "Details..." object properties dialog.

- 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:  fcwilt
11708.9 In reply to 11708.8 
Morning Michael,

The ability to save/restore a set of selected objects was so useful, I created a similar set of commands to save/restore a set of "not hidden" objects which has already proven to be even more useful.

I'm also planning on using that same object related key/value feature (for lack of a better term) to create my sets of objects to be exported, rather than use a object name prefix.

My next goal is to figure out how to display a "dialog" like you do, in the upper right corner, which would allow specifying a set number (1 to 9) and provide proceed/cancel buttons.

I think I've got enough bits of info collected to get that working.

This scripting stuff is the greatest thing since sliced bread. ;)

Frederick
  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-7  8-9