Please point out my mistake.
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Please point out my mistake.

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Leonard Johnson
Guest





Posted: Thu Dec 09, 2004 12:48 am    Post subject: Please point out my mistake. Reply with quote

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

Back to top
Jorge Jimenez
Guest





Posted: Thu Dec 09, 2004 1:17 am    Post subject: Re: Please point out my mistake. Reply with quote

Quote:
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.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Leonard Johnson" <leonard@phalighting.com> wrote in message
news:41b75a83$1_2@newsprd01...
Quote:
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
Back to top
Leonard Johnson
Guest





Posted: Thu Dec 09, 2004 1:32 am    Post subject: Re: Please point out my mistake. Reply with quote

Thanks

"Jorge Jimenez" <unknown@nospam.com> wrote in message
news:41b76141_2@newsprd01...
Quote:
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.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Leonard Johnson" <leonard@phalighting.com> wrote in message
news:41b75a83$1_2@newsprd01...
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




Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB