Danielm103 Posted March 28 Posted March 28 (edited) uses convertFieldToText https://help.autodesk.com/view/OARX/2024/ENU/?guid=OARX-RefGuide-AcDbText__convertFieldToText import traceback from pyrx_imp import Rx from pyrx_imp import Ge from pyrx_imp import Gi from pyrx_imp import Db from pyrx_imp import Ap from pyrx_imp import Ed from pyrx_imp import Gs # debug def PyRxCmd_pydebug() -> None: import PyRxDebug PyRxDebug.startListener() #converts fields to text for seleted refs def PyRxCmd_fieldnuker5000() -> None: try: #modify filter filter = [(Db.DxfCode.kDxfStart, "INSERT")] ssres: tuple[Ed.PromptStatus,Ed.SelectionSet] = Ed.Editor.select(filter) if ssres[0] != Ed.PromptStatus.eOk: print("Oops {}: ".format(ssres[0])) return for refid in ssres[1].objectIds(): ref = Db.BlockReference(refid) for attid in ref.attributeIds(): attref = Db.AttributeReference(attid,Db.OpenMode.kForWrite) if attref.hasFields(): attref.convertFieldToText() except Exception as err: traceback.print_exception(err) #converts fields to text for named block def PyRxCmd_fieldnuker9000() -> None: try: name = "Brdrtemplate" # getname db = Db.curDb() bt = Db.BlockTable(db.blockTableId()) #find the block if not bt.has(name): return #oof btrid = bt.getAt(name) btr = Db.BlockTableRecord(btrid) #nuke em from orbit attdefids = btr.objectIds(Db.AttributeDefinition.desc()) for attdefid in attdefids: attdef = Db.AttributeDefinition(attdefid,Db.OpenMode.kForWrite) if attdef.hasFields(): attdef.convertFieldToText() for refid in btr.getBlockReferenceIds(): ref = Db.BlockReference(refid) for attid in ref.attributeIds(): attref = Db.AttributeReference(attid,Db.OpenMode.kForWrite) if attref.hasFields(): attref.convertFieldToText() except Exception as err: traceback.print_exception(err) Edited March 28 by Danielm103 typo Quote
BIGAL Posted March 29 Posted March 29 Your python solutions are increasing maybe make a doc of what they all do with some images no code. This needs updating. Lisp files June 2023.docx 1 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.