-
Beta Was this translation helpful? Give feedback.
Answered by
CEXT-Dan
Jul 17, 2025
Replies: 2 comments 5 replies
-
maybe something like this, there's a sample drawing in PySamples\dwg\dynamicBlock.dwg import traceback
from pyrx import Ap, Ax, Db, Ed, Ge, Gi, Rx
@Ap.Command()
def doit():
try:
db = Db.curDb()
ps, id, _ = Ed.Editor.entSel("\nPick a block", Db.BlockReference.desc())
if ps != Ed.PromptStatus.eOk:
raise RuntimeError("Selection Error! {}: ".format(ps))
dynref = Db.DynBlockReference(id)
if not dynref.isDynamicBlock():
print("oof")
return
newref = Db.BlockReference(Ge.Point3d(0, 0, 0),dynref.dynamicBlockTableRecord())
newrefid = db.addToModelspace(newref)
except Exception as err:
traceback.print_exception(err) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I want to insert a new dynamicBlock that is seleted, and change the block's properties. But when i insert the new block, that always display blocks that are not dynamic. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, try this code on the screw block