Hello,
I'm sure this is pretty simple but for whatever reason, I can't figure this one out!
I'm trying to scale my layout 48 times bigger. Like so:
But whenever I insert my DWG template, this is the scale of my xyz:
How can I change this geometry scaling programmatically?
Thanks ... I feel like I'll regret posting this question because of the simple answer that's coming!
Solved! Go to Solution.
You need to make selection set..
then you can use tranform matrix from autocad.net
Blog for your reference.
I figured out that we need to create a new Scale3d(x,y,z) to the ScaleFactor of the block reference being inserted.
When I insert my drawing I need to set this like so:
Using lock As DocumentLock = acDoc.LockDocument Using tr As Transaction = db.TransactionManager.StartTransaction() bt = TryCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable) btr = TryCast(tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord) Using newdb As New Database(False, True) newdb.ReadDwgFile(templateName, IO.FileShare.Read, True, Nothing) btrId = db.Insert(templateName, newdb, True) End Using
Dim blkRef As BlockReference = New BlockReference(New Point3d(0, 0, 0), btrId)
blkRef.ScaleFactors = New Scale3d(48, 48, 1) 'Modify scale to needs
btr.AppendEntity(blkRef)
tr.AddNewlyCreatedDBObject(blkRef, True) tr.Commit() End Using
End Using
That's how I scale my drawing being inserted.
Can't find what you're looking for? Ask the community or share your knowledge.