Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
bodhran
Posts: 69
Registered: ‎10-14-2010
Message 1 of 7 (265 Views)

RE-size Viewports across Multiple Layouts

265 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

*Expert Elite*
pbejse
Posts: 2,432
Registered: ‎11-24-2009
Message 2 of 7 (255 Views)

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)?


 

Valued Contributor
bodhran
Posts: 69
Registered: ‎10-14-2010
Message 3 of 7 (236 Views)

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
*Expert Elite*
pbejse
Posts: 2,432
Registered: ‎11-24-2009
Message 4 of 7 (227 Views)

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

 

 

 


 

Valued Contributor
bodhran
Posts: 69
Registered: ‎10-14-2010
Message 5 of 7 (205 Views)

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

*Expert Elite*
pbejse
Posts: 2,432
Registered: ‎11-24-2009
Message 6 of 7 (191 Views)

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?

 

Valued Contributor
bodhran
Posts: 69
Registered: ‎10-14-2010
Message 7 of 7 (181 Views)

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community