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

0 Members and 1 Guest are viewing this topic.

JohnSnow

  • Newt
  • Posts: 37
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

  • Newt
  • Posts: 134
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

  • Newt
  • Posts: 133
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: 37
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: 37
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