It looks like you're new here. If you want to get involved, click one of these buttons!
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
So this should work:
shape = tcp.shapes(l3_id).insert(box)
shape.set_property(key, value)
Sebastian
Hello Sebastian,
many thanks for the hint! It works perfectly like this.
Kind Regards
Thomas