@JGranata_GdB wrote:
I guess the safest way would be to scale blocks from a selection set. .... run the command, select all blocks in the 'legend' (i would use a box selection method by dragging my mouse over the area) and then enter in the scale factor. ....
If they don't include duplicates, nor dynamic Blocks, this quickie should do it:
(defun C:SBD ; = Scale Block Definitions
(/ ss sf n)
(command "_.layer" "_thaw" "*" "_unlock" "*" "_on" "*" "")
(if
(and
(setq ss (ssget '((0 . "INSERT"))))
(setq sf (getreal "\nScale factor: "))
); and
(repeat (setq n (sslength ss)); then
(command
"_.-bedit" (cdr (assoc 2 (entget (ssname ss (setq n (1- n))))))
"_.scale" "_all" "" "0,0" sf
"_.bclose" "_save"
)
); repeat
); if
(command "_.layerp")
(princ)
); defun
If there's more than one of the same Block among the selection, it will apply the scale factor to its ingredients as many times. If there could be dynamic Blocks, a different way would need to be used to get their Block names.
Another possible complication would be if any of them contain any nested Blocks inside that are also in the selection on their own -- such nested ones would be scaled within themselves, and then again within any Blocks they're nested in. [For instance, I have a Block of a duplex receptacle symbol for electrical plans, and I have a Block for a GFI receptacle that has the "plain" receptacle nested in it, plus the GFI Text.] That could probably be avoided, but would take a bunch more code.
Kent Cooper, AIA