shape.StaticID
A unique ID within the file, read-only, and stable across reopening. The most dependable way to dedupe during traversal — the same object can arrive down several pat
Signature
shape.StaticID
Notes
A unique ID within the file, read-only, and stable across reopening. The most dependable way to dedupe during traversal — the same object can arrive down several paths.
Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
shape = app.ActiveSelectionRange(1)
print("Unique ID: ", shape.StaticID)
# dedupe by ID while walking
seen = set()
layer = doc.ActivePage.ActiveLayer
for i in range(1, layer.Shapes.Count + 1):
s = layer.Shapes.Item(i)
sid = s.StaticID
if sid in seen:
continue
seen.add(sid)
print("Shapes after dedupe: ", len(seen))
About this section: Object Data
Object Data — object data and document properties.
- This section has 6 entries; this is one of them.
- See the full section index: Object Data
Other entries in this section
- shape.NameThe object name shown in the Object Manager. Read/write — name things
- shape.URLA hyperlink attached to the object, carried out on PDF export. Interac
- shape.PowerClipParent / shape.Layer / shape.PageWalks back up: which frame clips this object, which layer, which page.
- doc.PropertiesFile properties (title, author, keywords, notes). Fill them in consist
- doc.MetadataThe metadata collection, finer-grained than Properties and it takes cu