Skip to content
Discussion options

You must be logged in to vote

Then if one wants to scale the block reference on insertion one could add another funtion:

def insertBlockRef(db: Db.Database, btrid: Db.ObjectId, coords: Ge.Point3d, scale: Ge.Scale3d):
    blockRef = Db.BlockReference(coords, btrid)
    blockRef.setScaleFactors(scale)
    model = Db.BlockTableRecord(db.modelSpaceId(), Db.OpenMode.kForWrite)
    blockRefId = model.appendAcDbEntity(blockRef)
    return blockRefId

and in main() one could then call after closing the block table.

        brefid = insertBlockRef(db, blkid, Ge.Point3d(2,2,0), Ge.Scale3d(4., .5, 1.))

Zero values in Scale3d are not permitted by default

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by schoeller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant