I added many defintions, and kept its guid like this:
definition = Sketchup.active_model.definitions.add(defintion_name) definition.set_attribute("MYDIC", "origuid", definition.guid)
After, I iterated Sketchup.active_model.definitions to read its attributes to find out the origuid to get what definition I wanted. But when the number of definitions increased, it was time-consuming to find out the right definition.
Is there a quick way to get a definition. I am wondering if the index of a definition is a possible solution. Save the index when adding a definition, then access it by the index after. How can I get the index of a definition when it is added. If it will change when adding instances to it?