PDA

View Full Version : Please point out my mistake - Scaling Blocks



leonard.72630
2004-12-08, 07:52 PM
I'm trying to scale mulptile block about their insertion point. Could someone please point out my mistake?

Dim objDrawing As AcadBlockReference
Dim varEntityPickedPoint As Variant
Dim InsertionPoint As Variant
Dim dblScaleFactor As Double
Dim objScale As AcadBlockReference
Dim objSelSet As AcadSelectionSet

Set objSelSet = ThisDrawing.PickfirstSelectionSet
objSelSet.SelectOnScreen

On Error Resume Next

InsertionPoint = objDrawing.InsertionPoint

dblScaleFactor = ThisDrawing.Utility.GetReal("Enter the scale factor: ")

'Scale the object

For Each objDrawing In objSelSet
Set objScale = objDrawing.ScaleEntity
objScale InsertionPoint, dblScaleFactor

Next objDrawing
objSelSet.Delete

Exit_Here:
Exit Sub

End Sub

Ed Jobe
2004-12-08, 08:20 PM
Before that, could you tell us what you think it is doing wrong.

leonard.72630
2004-12-08, 09:24 PM
After stepping away for a while I see that

InsertionPoint = objDrawing.InsertionPoint

is in the wrong spot. I believe it should look like this:

For Each objDrawing In objSelSet
InsertionPoint = objDrawing.InsertionPoint
Set objScale = objDrawing.ScaleEntity
objScale InsertionPoint, dblScaleFactor