VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set all blocks to scale uniformly

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
482 Views, 2 Replies

Set all blocks to scale uniformly

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
2 REPLIES 2
Message 2 of 3
msarqui
in reply to: Anonymous

Hi,

 

Sorry for the question but how to use it?

 

Thanks

Message 3 of 3
Alfred.NESWADBA
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 ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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

Post to forums  

Autodesk Design & Make Report

”Boost