-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
This bug refers to https://www.klayout.de/forum/comments.php?DiscussionID=1048.
The following code won't retrieve the shape property with key 2 on the attached layout with Python 3.
lv = pya.LayoutView.current()
for obj in lv.each_object_selected():
print(repr(obj.shape.property(2)))
Reason: the strongly typed keys changed to 64 bit in Python 3 on Windows. On Linux, 32 and 64bit are equivalent (the internal type is long which is == long long). Still the problem exists because of the Windows-induced strong typing.
This is a (slow) workaround:
# Don't do this too often:
key = pya.Expression.eval("2")
lv = pya.LayoutView.current()
for obj in lv.each_object_selected():
print(repr(obj.shape.property(key)))
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels