How to evaluate if a entity "insert" are inserted in a PaperSpace or in a Model Space #680
Replies: 1 comment 3 replies
-
The There are more kind of layouts than from ezdxf.entities import is_graphic_entity
...
for e in doc.query("*"):
if not is_graphic_entity(e):
continue
layout = e.get_layout()
if layout is not None:
if layout.is_modelspace:
print(f"entity {e} is located in the modelspace")
elif layout.is_any_paperspace:
print(f"entity {e} is located in paperspace '{layout.name}'")
elif layout.is_block_layout:
print(f"entity {e} is located in block '{layout.name}'")
else:
print(f"entity {e} has no parent layout") Be aware, if you query the whole document you can get entities that are not subclasses of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I need to evaluate if a entity "insert" is in modelspace or in a paperspace, but all the ways that I tryed dont give me positive results.
Someone can help me?
Beta Was this translation helpful? Give feedback.
All reactions