Assigning User Properties to a Shape already at (or before) creation/insertion time

While parsing a text file for xy location data I am creating box shapes accordingly and place them in a specific cell under a specific layer.

box = DBox.new(defectX+sclX, defectY+sclY, defectX+sclX+width, defectY+sclY+height).moved(-width / 2, -height / 2)
tcp.shapes(l3_id).insert(box)

I would like to make use of the user properties of these shapes in order to store some data in these for identifying the shapes later on. I wonder, if there is a method to populate the user properties already at creation/insertion time or immediately thereafter (or before) to avoid having to iterate through the entire shape collection again. I found the set_property method of the Shape Class, but the only examples I saw were requiring to get the shape from an existing list first, by iterating through the shape list of the respective cell. Is there a way to define the user properties already upon definition of the shape?

Kind Regards
Thomas

Comments

Sign In or Register to comment.