Automatic Papersize

Automatic Papersize

thomas_schluesselberger
Advocate Advocate
10,755 Views
93 Replies
Message 1 of 94

Automatic Papersize

thomas_schluesselberger
Advocate
Advocate

Hi!

 

I don't think there is a solution for this, but please convince me otherwise:

 

I would like a LISP program that allows me to automatically crop the paper sizes of all layouts. So the paper size should automatically adapt to the objects in the layout. So that there is no white border outside the viewport.

I would then like to create pdfs with "publish" as normal, but I don't want to have to crop the PDF every time.

 

Until now i always have to manually create a new paper size and set each layout individually.

 

0 Likes
Accepted solutions (1)
10,756 Views
93 Replies
Replies (93)
Message 81 of 94

thomas_schluesselberger
Advocate
Advocate

Just as intended, when i use my dynamic block, the two parameters are recognized and the paper format is adjusted accordingly.

 

But 5 seconds ago, i found out that when i execute mpsetup at model area, it jumps into a layout.

Could you change, that it doesn't open a layout when executing mpsetup at model area?

 

Would be good, because some layouts need to load very long at some drawings and if i want to execute mpsetup for all layouts i don't need to be inside a layout.

0 Likes
Message 82 of 94

Moshe-A
Mentor
Mentor

To make it clear, you want to invoke mpsetup from model space to be working on layouts without seeing nothing? How would you know if something went wrong?

0 Likes
Message 83 of 94

thomas_schluesselberger
Advocate
Advocate

Yes, that's what i want.

I don't think that much can go wrong. But if something wents wrong and i don't see it immediately i will see it at latest at my plot program. So, nothing to worry about.

 

 

 

0 Likes
Message 84 of 94

Moshe-A
Mentor
Mentor

@thomas_schluesselberger ,

 

Thomas, can not believe we came so far, never been involved in a thread such a long time but i'm very glade we brought it to work just as you wanted. look back what i said on page 2 message #22 back then, i had no idea to what i am entering 😀 cause as i said, this is my first time dealing with plotting configuration/layout objects.

 

Attached this update, when run from model space, Regen is suppressed.

 

Moshe

 

0 Likes
Message 85 of 94

thomas_schluesselberger
Advocate
Advocate

Hi!

 

Thanks for your patience and for your help.


I believe that you not only helped me but also many others with the LISP.

The post has almost 2000 views now, so I think there is a lot of interest here.

 

I will write an answer summarizing the main points in the next few days when I have more time. Then people who come to this post later can see directly what the LISP is doing and what they have to do to make it run. Then nobody has to search through the 83 messages.

 

I have just one last request:
Is it possible that you send the .lsp file from the mpsetup-LISP. So i can see the code.

I'm at the beginning of trying to learn LISP programming and I would be interested in how you created the LISP. Maybe in some future LISP's i creat myself, it's gonna help me.

 

 

0 Likes
Message 86 of 94

Moshe-A
Mentor
Mentor

@thomas_schluesselberger 

 

Some how you do not have private message box here so me your email

 

Moshe

0 Likes
Message 87 of 94

thomas_schluesselberger
Advocate
Advocate
Hi @Moshe-A

my mail is: "thomas.schluessi@gmail.com"

0 Likes
Message 88 of 94

andkal
Collaborator
Collaborator

Hi
The new release of PAPER_SHEET_FORMAT (link) makes something simillar to what you described. Previos release when you tested it in december didn't have that function at that time. You can take a look at it too, maybe you will be interrested in such solution.
Pc3 files unfortunately cannot be accesed with lisp, hence paper size has to be selected/added manually in Page Setup Manager.
quickpagesetup.gif


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes
Message 89 of 94

thomas_schluesselberger
Advocate
Advocate
Hello,

The LISP looks very good, but unfortunately it doesn't quite do what I want. The paper format must adjust itself automatically over several layouts and without picking the frame.
The LISP that moshe-A made, gave me all the functions I wanted.

But still, thanks for your answer.
0 Likes
Message 90 of 94

thomas_schluesselberger
Advocate
Advocate

So.... @Moshe-A 

 

I just found a new "problem".

 

One of your last changes was, that if there is a dynamic block, the LISP looks for the parameter "Laenge" and "Hoehe" to get the bounding box. That's all good an still works really nice with my big plans.

 

But i got a problem with my A3/A4 plans.

 

Now the problem is the following: I have a block for A4 frame which has a block property table to set the current planstatus.

I think that this sets the block to a dynamic block. But this block is static, so it doesn't change widht/hight and it doesn't have the parameters. 

 

So when using mpsetup i always get this error:

"Linear Parameter "Laenge" is not found in block "*U12". Can not find bounding box in Layout1 layout."

 

I assume it works like this: If lisp finds dynamic block in layout -> lisp looks for paramaters and take them as bounding box. But as i don't have parameters in this block it doesn't work.

 

I know that i could work around by just adding invisible parameters to the blocks, but that's not really nice.

 

Any idea of how to fix this?

Maybe something like that:

-> If LISP finds dynamic block

-> LISP looks if this block has parameters "Laenge" and "Hoehe"

-> Parameters found -> LISP taking them as bounding box (just as it works right now)

-> Parameters not found -> LISP takes bounding box from normal polylines

 

I attached you my block where i have the problems.

 

Thank you in advance for your help 🙂

 

0 Likes
Message 91 of 94

Moshe-A
Mentor
Mentor

@thomas_schluesselberger  hi,

 

i will look at this tonight (hope 😀)

 

Moshe

0 Likes
Message 92 of 94

Moshe-A
Mentor
Mentor
Accepted solution

@thomas_schluesselberger  hi,

 

here is my fix 😀

 

enjoy

moshe

 

0 Likes
Message 93 of 94

thomas_schluesselberger
Advocate
Advocate

Hi!

 

Thank you very much again, works now! 🙂 

0 Likes
Message 94 of 94

haper74945
Explorer
Explorer

Hi Moshe,

 

if you're not willing to share the lisp file, could you give some insights on how you solved this problem?

I was under the impression that pc3 files can't be accessed via lisp.

0 Likes