Yes, I believe that would work fine. However, I recommend using the Entity member entityID instead, like this: Sketchup.active_model.definitions.entityID. This one also doesn't persist between sessions, but it is a unique index across all entities Sketchup has loaded (even with multiple models), and active_model.definitions is a SketchUp entity.
So under OSX this returns a new integer for each model opened.
But under Windows it returns the same integer even if you open or create a new model. It appear to reuse the DefinitionList entity.
Original report by me.
http://sketchucation.com/forums/viewtopic.php?f=180&t=43219&p=484242#p484242
Yes, I believe that would work fine. However, I recommend using the Entity member entityID instead, like this: Sketchup.active_model.definitions.entityID. This one also doesn't persist between sessions, but it is a unique index across all entities Sketchup has loaded (even with multiple models), and active_model.definitions is a SketchUp entity.
So under OSX this returns a new integer for each model opened. But under Windows it returns the same integer even if you open or create a new model. It appear to reuse the DefinitionList entity.