Visual Basic Customization

Visual Basic Customization

Reply
Active Member
timbot
Posts: 10
Registered: ‎08-23-2006
Message 1 of 3 (185 Views)

Set all blocks to scale uniformly

185 Views, 2 Replies
09-08-2006 07:19 AM
so i've been trying to make a routine forever that will set all the blocks to scale uniformly without success... until today!! in case anybody else is having trouble doing the same thing, i thought it would be nice of me to post my code B)

Lisp part:

(defun c:bsu ()
(princ "\nBlock Scale Uniformly\n")
(vl-vbaload (strcat home "/vba/timVBA.dvb"))
(vl-vbarun "block_scale_uniformly")
(princ)
)

VBA Part:

Public Sub block_scale_uniformly()

Dim block As AcadBlock
Dim entity As AcadEntity

For Each block In ThisDrawing.Blocks
If "*Model_Space" = block.Name Or "*MODEL_SPACE" = block.Name Then
GoTo nextblock
Else
If "*Paper_Space" = block.Name Or "*PAPER_SPACE" = block.Name Then
GoTo nextblock
Else
block.BlockScaling = acUniform
End If
End If
nextblock:
Next block

End Sub
Distinguished Contributor
msarqui
Posts: 134
Registered: ‎09-14-2010
Message 2 of 3 (147 Views)

Re: Set all blocks to scale uniformly

02-06-2013 04:31 PM in reply to: timbot

Hi,

 

Sorry for the question but how to use it?

 

Thanks

*Expert Elite*
Alfred.NESWADBA
Posts: 9,100
Registered: ‎06-29-2007
Message 3 of 3 (140 Views)

Re: Set all blocks to scale uniformly

02-07-2013 12:33 AM in reply to: msarqui

Hi,

 

>> Sorry for the question but how to use it?

Start command _VBAIDE (if you need a VBA-Enabler then install it from >>>here<<<), then copy the "VBA part" from the original message into the code-window of VBAIDE. Having done that (and maybe saved the project) you can go back to AutoCAD, then start command _VBARUN and select the item block_scale_uniformly to be executed.

 

Just to make sure: that's a description how you can use it, I have not tested the code (as e.g. XRefs might be a problem here).

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.