Created
July 5, 2020 06:26
-
-
Save chuongmep/156fb4d0d9f5b4375317213b977a9c52 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) | |
output.append(obj1) | |
OUT = output,ed.WriteMessage("Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment