Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to scale drawing?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
712 Views, 3 Replies

How to scale drawing?

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:

scaleGOOD.png

 

But whenever I insert my DWG template, this is the scale of my xyz:

scaleBAD.png

 

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! 

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

You need to make selection set..

then you can use tranform matrix from autocad.net

http://through-the-interface.typepad.com/through_the_interface/2010/12/a-simple-command-to-perform-a...

Blog for your reference.

Tags (1)
Message 3 of 4
Anonymous
in reply to: Anonymous

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.

Message 4 of 4
Anonymous
in reply to: Anonymous

Yeah I saw Kean's post as well. I figured there was an easier way to solve this once the drawing was inserted.

Thanks for the link anyway though!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report