Danielm103 Posted March 13 Posted March 13 (edited) import traceback from pyrx import Rx, Ge, Gi, Db, Ap, Ed, command @command(name="doit") def justDoit(): binfo = {} db = Db.curDb() bt = Db.BlockTable(db.blockTableId()) for name, id in bt.asDict().items(): btr = Db.BlockTableRecord(id) if btr.isAnonymous() or btr.isLayout(): continue if btr.isFromExternalReference() or btr.isFromOverlayReference(): continue binfo[name] = id table = Db.Table() table.setDatabaseDefaults(db) table.setTableStyle(db.tablestyle()) table.setSize(len(binfo) + 2, 5) table.generateLayout() irow = 2 icol = 0 for name, id in binfo.items(): table.setBlockTableRecordId(irow, icol, id, True) table.setTextString(irow, icol + 1, name) irow += 1 icol = 0 db.addToModelspace(table) Edited March 13 by Danielm103 typo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.