• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Valued Contributor
    bodhran
    Posts: 69
    Registered: ‎10-14-2010

    RE-size Viewports across Multiple Layouts

    172 Views, 6 Replies
    06-25-2012 03:19 PM

     

     

    Just wondering if any one has a routine to re-size viewports in multiple layouta??

     

    We have to re-size viewports as they were created a little too small and are now spread across almost 1000 drawings in 18 dwg.

     

    Thanks,

     

    B

    Please use plain text.
    *Expert Elite*
    Posts: 2,057
    Registered: ‎11-24-2009

    Re: RE-size Viewports across Multiple Layouts

    06-25-2012 09:47 PM in reply to: bodhran

    bodhran wrote:

     

     

    Just wondering if any one has a routine to re-size viewports in multiple layouta??

     

    We have to re-size viewports as they were created a little too small and are now spread across almost 1000 drawings in 18 dwg.

     

    Thanks,

     

    B


    Too smaill in terms of viewport scale? or the size of the viewport (L&W)?


     

    Please use plain text.
    Valued Contributor
    bodhran
    Posts: 69
    Registered: ‎10-14-2010

    Re: RE-size Viewports across Multiple Layouts

    07-02-2012 04:21 PM in reply to: pbejse
    Sorry for the late reply. It's the Length & Widht i'd like ot be able ot modify. Thanks, B
    Please use plain text.
    *Expert Elite*
    Posts: 2,057
    Registered: ‎11-24-2009

    Re: RE-size Viewports across Multiple Layouts

    07-02-2012 11:16 PM in reply to: bodhran

    bodhran wrote:
    Sorry for the late reply. It's the Length & Widht i'd like ot be able ot modify. Thanks, B

    This demo would re-size the viewprot on all layout tabs by mulitplying the current viewprot size by a factor supplied by the user and keepingthe viewport scale intact

     

    (Defun c:smileyvery-happy:emo1 ( / factor vps)
          (initget 1)
          (setq factor (getreal "\nEnter re-size factor: "))
           (setq vps (ssget "_X" '((0 . "Viewport") (-4 . "/=") (69 . 1))))
           (repeat (sslength vps)
                               (setq e (vlax-ename->vla-object (ssname vps 0)))
                               (setq cscale (vla-get-CustomScale e))
          (vlax-invoke e 'ScaleEntity (vlax-get e 'Center) factor)
          (vla-put-CustomScale e cscale)
                               (ssdel (ssname vps 0) vps)
                               )
          (princ)
          )

     

    This on the other hand will scale even the viewport scale by a factor supplied by the user

     

    (Defun c:smileyvery-happy:emo2 ( / factor vps)
          (initget 1)
          (setq factor (getreal "\nEnter re-size factor: "))
           (setq vps (ssget "_X" '((0 . "Viewport") (-4 . "/=") (69 . 1))))
           (repeat (sslength vps)
                               (setq e (vlax-ename->vla-object (ssname vps 0)))
          (vlax-invoke e 'ScaleEntity (vlax-get e 'Center) factor)
                               (ssdel (ssname vps 0) vps)
                               )
          (princ)
          )

     

    Now if you have a specific length and with in mind , you may want to supply "what is" and "what will" or just go ahead and assigned them  regardless of what was.

     

    HTH

     

     

     


     

    Please use plain text.
    Valued Contributor
    bodhran
    Posts: 69
    Registered: ‎10-14-2010

    Re: RE-size Viewports across Multiple Layouts

    07-10-2012 09:15 PM in reply to: pbejse

    Exceelent work!!

     

    Is it possible to change the horizontal size and vertical size? 

    even seperate routines would be good.

     

    Regards,

     

    B

    Please use plain text.
    *Expert Elite*
    Posts: 2,057
    Registered: ‎11-24-2009

    Re: RE-size Viewports across Multiple Layouts

    07-11-2012 05:21 AM in reply to: bodhran

    bodhran wrote:

    Exceelent work!!

     

    Is it possible to change the horizontal size and vertical size? 

    even seperate routines would be good.

     

    Regards,

     

    B



    Is that Horizontal and/or Vertical? it can be done with one routine.

     

    Notice the snippets i posted us a factor as multiplier, is that what you want? or a pre-determined Lenght and Width?

    (WWAWW: what was and what will)

     

    What about the viewport scale?

     

    Please use plain text.
    Valued Contributor
    bodhran
    Posts: 69
    Registered: ‎10-14-2010

    Re: RE-size Viewports across Multiple Layouts

    07-12-2012 04:07 PM in reply to: pbejse

     

     

    Hi there,

     

    At the moment it's just a vertical re-sizing i need but if it isn't too much trouble to produce somethign that could re-size horizontal too i'd rally appreicate the help.

     

    I'd like to keep the scale the same for all viewports, they were created to dispaly an output from 3rd party software, the guys producing the outputs had to exceed the limits they were gien in model space and now i'd like ot make the viewports taller but keep the current scale.

     

    Regards,

     

    B

    Please use plain text.