Created
July 5, 2020 06:34
-
-
Save chuongmep/df56a6b4e3d1c6a5fe27a6bf2f4372fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output = [] | |
adoc = Application.DocumentManager.MdiActiveDocument | |
ed = adoc.Editor | |
with adoc.LockDocument(): | |
with adoc.Database as db: | |
with db.TransactionManager.StartTransaction() as t: | |
bt = t.GetObject(db.BlockTableId, OpenMode.ForWrite) | |
btr = t.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) | |
for objectid in btr: | |
obj1 = t.GetObject(objectid, OpenMode.ForRead) | |
if obj1.Layer == "Layer1": | |
output.append(obj1) | |
else: | |
pass | |
OUT = output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment