Author Topic: Scaling all blocks globally w/o redefining  (Read 3641 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Scaling all blocks globally w/o redefining
« on: April 08, 2005, 11:39:27 AM »
Form time to time we have to change the scale of our viewports from 1/8" to 1/4" or vice versa. The problem is that the drawing has been completed with all blocks inserted. We may have dozens of blocks so redefining each one is not pratiucal due to the fact our client may request a scale change 2 to 3 hours before the drawings are to be plotted and delivered. Is there anyway these blocks can be scaled to a different scale at their insertion point and do it sucessfully?

Thanks

hudster

  • Gator
  • Posts: 2848
Scaling all blocks globally w/o redefining
« Reply #1 on: April 08, 2005, 02:45:00 PM »
Oh thats a good one.  I've had to this as well, if anyone has a way to do this it would be great.

But what would be better if it could scale everything around it's insertion point, text, blocks, dimensions etc, but not the Xref as the building outline should remain as it is.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

MikePerry

  • Guest
Re: Scaling all blocks globally w/o redefining
« Reply #2 on: April 08, 2005, 03:12:23 PM »
Quote from: TJAM51
Is there anyway these blocks can be scaled to a different scale at their insertion point and do it sucessfully?
Hi

QSelect and Properties Window (Palette).

Have a good one, Mike

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Scaling all blocks globally w/o redefining
« Reply #3 on: April 08, 2005, 03:17:52 PM »
Here's one that handles Text, Mtext and blocks. For Dimensions, just change the Dimstyle scalefactor.
Code: [Select]

(defun c:rescale (/ ss val idx obj)
  (princ "\nSelect text and or blocks to rescale: ")
  (if (setq ss (ssget '((0 . "TEXT,MTEXT,INSERT"))))
    (progn
      (if (not *rescale*)
(setq *rescale* 0.5)
)
      (if (setq val (getreal (strcat "\nRescale by what value?<" (rtos *rescale* 2 2) ">: ")))
(setq *rescale* val)
)
      (setq idx -1)
      (while (< (setq idx (1+ idx))(sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss idx)))
(cond ((wcmatch (vla-get-objectname obj) "*Block*")
      (vla-put-xscalefactor obj (* (vla-get-xscalefactor obj) *rescale*))
      (vla-put-yscalefactor obj (* (vla-get-yscalefactor obj) *rescale*))
      (vla-put-zscalefactor obj (* (vla-get-zscalefactor obj) *rescale*))
      )
     (T
      (vla-put-height obj (* (vla-get-height obj) *rescale*))
      )
     )
)
      )
    )
  (princ)
  )

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Scaling all blocks globally w/o redefining
« Reply #4 on: April 08, 2005, 04:16:41 PM »
Here's another flavor for ideas ...

Code: [Select]
;;  insitu scale

(defun c:iScale ( / _IScale _GetReal _Main )

    (defun _IScale ( object factor )
        ;; trap locked layer errors
        (vl-catch-all-apply
           '(lambda ()
                (cond
                    ;;  make it easy to add other objects in the future
                    (   (vlax-property-available-p object 'XScaleFactor)
                        (foreach property
                           '(XScaleFactor YScaleFactor ZScaleFactor)
                            (vlax-put-property
                                object
                                property
                                (* factor (vlax-get-property object property))
                            )
                        )
                    )
                    (   (vlax-property-available-p object 'Height)
                        (vla-put-height    
                            object
                            (*  factor
                                (vla-get-height object)
                            )
                        )
                    )
                )
            )
        )    
    )
   
    (defun _GetReal ( pmt default initgetbits / response )
        (if (eq 'int (type initgetbits))
            (initget (logand (~ 1) initgetbits))
        )    
        (if    
            (setq response
                (getreal    
                    (strcat
                        pmt
                        " <"
                        (rtos default 2 3)
                        ">: "
                    )
                )
            )
            response
            default
        )
    )
   
    (defun _Main ( / ss i )
        (princ "\nSelect (m)text, attdefs or inserts to iScale: ")
        (cond
            (   (setq ss (ssget '((0 . "text,mtext,attdef,insert"))))                
                (setq *IScaleFactor*
                    (_GetReal
                        "\nEnter scaling factor"
                        (if (numberp *IScaleFactor*)
                            *IScaleFactor*
                            0.5
                        )
                        (+ 2 4)
                    )
                )
                (repeat (setq i (sslength ss))
                    (_IScale
                        (vlax-ename->vla-object
                            (ssname ss (setq i (1- i)))
                        )
                        *IScaleFactor*
                    )    
                )
            )    
        )
        (princ)
    )
   
    (_Main)
 
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Scaling all blocks globally w/o redefining
« Reply #5 on: May 22, 2006, 04:07:49 PM »
I can't seem to get this to work. It seems that it only scales the items (Mtext) inside the Mtext editor not on the screen. What am I doing wrong?


Code: [Select]
(defun c:rescale (/ ss val idx obj)
 (princ "\nSelect text and or blocks to rescale: ")
 (if (setq ss (ssget '((0 . "TEXT,MTEXT,INSERT"))))
   (progn
     (if (not *rescale*)
(setq *rescale* 0.5)
)
     (if (setq val (getreal (strcat "\nRescale by what value?<" (rtos *rescale* 2 2) ">: ")))
(setq *rescale* val)
)
     (setq idx -1)
     (while (< (setq idx (1+ idx))(sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss idx)))
(cond ((wcmatch (vla-get-objectname obj) "*Block*")
      (vla-put-xscalefactor obj (* (vla-get-xscalefactor obj) *rescale*))
      (vla-put-yscalefactor obj (* (vla-get-yscalefactor obj) *rescale*))
      (vla-put-zscalefactor obj (* (vla-get-zscalefactor obj) *rescale*))
      )
     (T
      (vla-put-height obj (* (vla-get-height obj) *rescale*))
      )
     )
)
     )
   )
 (princ)
 )

Code: [Select]
(defun c:iScale ( / _IScale _GetReal _Main )

   (defun _IScale ( object factor )
       ;; trap locked layer errors
       (vl-catch-all-apply
          '(lambda ()
               (cond
                   ;;  make it easy to add other objects in the future
                   (   (vlax-property-available-p object 'XScaleFactor)
                       (foreach property
                          '(XScaleFactor YScaleFactor ZScaleFactor)
                           (vlax-put-property
                               object
                               property
                               (* factor (vlax-get-property object property))
                           )
                       )
                   )
                   (   (vlax-property-available-p object 'Height)
                       (vla-put-height     
                           object
                           (*  factor
                               (vla-get-height object)
                           )
                       )
                   )
               )
           )
       )   
   )
   
   (defun _GetReal ( pmt default initgetbits / response )
       (if (eq 'int (type initgetbits))
           (initget (logand (~ 1) initgetbits))
       )   
       (if     
           (setq response
               (getreal   
                   (strcat
                       pmt
                       " <"
                       (rtos default 2 3)
                       ">: "
                   )
               )
           )
           response
           default
       )
   )
   
   (defun _Main ( / ss i )
       (princ "\nSelect (m)text, attdefs or inserts to iScale: ")
       (cond
           (   (setq ss (ssget '((0 . "text,mtext,attdef,insert"))))               
               (setq *IScaleFactor*
                   (_GetReal
                       "\nEnter scaling factor"
                       (if (numberp *IScaleFactor*)
                           *IScaleFactor*
                           0.5
                       )
                       (+ 2 4)
                   )
               )
               (repeat (setq i (sslength ss))
                   (_IScale
                       (vlax-ename->vla-object
                           (ssname ss (setq i (1- i)))
                       )
                       *IScaleFactor*
                   )   
               )
           )   
       )
       (princ)
   )
   
   (_Main)
 
)
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Scaling all blocks globally w/o redefining
« Reply #6 on: May 22, 2006, 04:14:55 PM »

My mistake. I figured it out. Is there a way to globally scale down Mtext from each of thier insertion point?
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Scaling all blocks globally w/o redefining
« Reply #7 on: May 22, 2006, 04:29:57 PM »
Why wouldn't filtering the objects and changing the scale values in the properties dialogue work?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Scaling all blocks globally w/o redefining
« Reply #8 on: May 22, 2006, 04:35:15 PM »

Quote
Why wouldn't filtering the objects and changing the scale values in the properties dialogue work?


I don't see any scale values to change. See attached. Also I attached a CAD drawing with an example of our Mtext that I need to be able to scale globally on all.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CADaver

  • Guest
Re: Scaling all blocks globally w/o redefining
« Reply #9 on: May 22, 2006, 05:13:44 PM »

My mistake. I figured it out. Is there a way to globally scale down Mtext from each of thier insertion point?
Dunno 'bout lispy, but there's the SCALETEXT command.

dtkell

  • Bull Frog
  • Posts: 217
Re: Scaling all blocks globally w/o redefining
« Reply #10 on: May 22, 2006, 07:17:23 PM »
I don't know hat you would use in arch desktop, but in land desktop 3, under utilities, there is an option to rescale blocks and text.
If there isn't a similar command in arch, then adesk didn't completely figure out how people would need to use the software.
\"What sane person could live in this world and not be crazy?\" -Ursula K. Le Guin