Author Topic: How do I select what to display in my viewport  (Read 1232 times)

0 Members and 2 Guests are viewing this topic.

JohnSnow

  • Newt
  • Posts: 52
How do I select what to display in my viewport
« on: May 12, 2022, 11:42:04 AM »
Hi,

I have used vla-AddPViewport to create a viewport in paper space. But I don't know how to set the contents I want from model space to be displayed in this viewport. What functions should I use?
I have searched online for awhile but no luck so far.
Any examples will be much appreciated!
 :smitten:

mhupp

  • Bull Frog
  • Posts: 250
Re: How do I select what to display in my viewport
« Reply #1 on: May 12, 2022, 12:06:17 PM »
Code - Auto/Visual Lisp: [Select]
Applies only to the Active viewport. you would then have to set the scale or refine it to your liking from there.

57gmc

  • Bull Frog
  • Posts: 358
Re: How do I select what to display in my viewport
« Reply #2 on: May 12, 2022, 02:13:13 PM »
After you create the vp, you use it's Center, Direction and Target properties to display what you want. For some sample code, find the acadauto.chm file in your acad folder or use the online ActiveX Developer Reference. Unfortunately, you have to translate the ActiveX from vba to lisp.
p.s. I found plenty of sample code by searching the lisp forum. Here's one sample.
« Last Edit: May 12, 2022, 02:49:52 PM by 57gmc »

JohnSnow

  • Newt
  • Posts: 52
Re: How do I select what to display in my viewport
« Reply #3 on: May 12, 2022, 10:35:25 PM »
Thank you very much. I will have a look

JohnSnow

  • Newt
  • Posts: 52
Re: How do I select what to display in my viewport
« Reply #4 on: May 14, 2022, 01:00:47 AM »
I have tried this (vla-zoomextents (vlax-get-acad-object)) and it works nice.
However, as mentioned it applies to active viewport only while I have multiple drawings opened at the same time of which viewports I want to set.
So I guess I cannot use this method unless I set sdi to be 0, which means I cannot have multiple drawings opened so I have to do it one by one.
One way I can think of is use .scr.
Do you have any other suggestions?
Thank you

framednlv

  • Newt
  • Posts: 64
Re: How do I select what to display in my viewport
« Reply #5 on: May 18, 2022, 11:49:55 AM »
Just my thoughts...

In paper space, type mview and then new.  It will change to model space and you draw a rectangle around what you want to show.  After you click enter to accept, it will change to paperspace.  You can then right click and select the scale you want to use.

Not sure when they added the new option, but it seems to work pretty good. 

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: How do I select what to display in my viewport
« Reply #6 on: May 22, 2022, 11:50:36 PM »
Is there a reason you have multiple dwgs why not 1 and multiple layouts.

My other suggestion is use a dwt with a correct layout setup so it has your title block note at 1:1 size. And a mview set up then just dbl click inside it and zoom E as a start.
A man who never made a mistake never made anything

JohnSnow

  • Newt
  • Posts: 52
Re: How do I select what to display in my viewport
« Reply #7 on: May 23, 2022, 10:12:23 PM »
I use sheet set manager with multiple drawings instead of one drawing with multiple layouts