TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JohnSnow 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:
-
Applies only to the Active viewport. you would then have to set the scale or refine it to your liking from there.
-
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 (https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-2B609059-6B70-4C66-A442-F5917363462A). 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 (https://www.theswamp.org/index.php?topic=47145.0;all).
-
Thank you very much. I will have a look
-
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
-
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.
-
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.
-
I use sheet set manager with multiple drawings instead of one drawing with multiple layouts