Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created July 5, 2020 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/156fb4d0d9f5b4375317213b977a9c52 to your computer and use it in GitHub Desktop.
Save chuongmep/156fb4d0d9f5b4375317213b977a9c52 to your computer and use it in GitHub Desktop.
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