Please point out my mistake.

Discussion in 'AutoCAD' started by Leonard Johnson, Dec 8, 2004.

  1. Public Sub SCBKL2()
    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
     
    Leonard Johnson, Dec 8, 2004
    #1
  2. InsertionPoint = objDrawing.InsertionPoint
    objDrawing hasn't been set yet !! Delete this line

    This should work

    For Each objDrawing In objSelSet
    InsertionPoint = objDrawing.InsertionPoint
    objDrawing.ScaleEntity InsertionPoint, dblScaleFactor
    Next objDrawing

    If it's only blockreferences you want to scale, you should filter
    your selection set, so no other type of entity is picked up.
     
    Jorge Jimenez, Dec 8, 2004
    #2
  3. Thanks

     
    Leonard Johnson, Dec 8, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.