Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

setting LIMMIN and LIMMAX

22 REPLIES 22
Reply
Message 1 of 23
Anonymous
1684 Views, 22 Replies

setting LIMMIN and LIMMAX

The below program works with AutoCAD 2000i, but not with AutoCAD 2005. How can I get this to work with A2K5.

Thanks.

(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) "LayoutDisplayPaper" 0)
(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) "LayoutDisplayMargins" 0)
(command "zoom" "extents")(command "limmin" (getvar "extmin"))(command "limmax" (getvar "extmax"))
Message was edited by: jclaidler
22 REPLIES 22
Message 2 of 23
Anonymous
in reply to: Anonymous

(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) 'LayoutDisplayPaper 0)
(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) 'LayoutDisplayMargins 0)

The items you want to put you use single quote (vlax-put object 'Properity value)

Tim
Message 3 of 23
Anonymous
in reply to: Anonymous

I still get this error:

Cannot set LIMMIN when paper margins or background are displayed.
Message 4 of 23
Anonymous
in reply to: Anonymous

(getvar "extmin") <- this returns (x y z)
When I tested stuff on my computer, "limmin" wants only (x y), so try this.
(setq oextmin (getvar "extmin")
oextmin (reverse (reverse (cdr oextmin)))
)
(setq oextmax (getvar "extmax")
oextmax (reverse (reverse (cdr oextmax)))
)

(setvar "limmin" oextmin)
(setvar "limmax" oextmax)
This should work.

Tim
Message 5 of 23
Anonymous
in reply to: Anonymous

nope... still get this error:

Cannot set LIMMAX when paper margins or background are displayed.
Message 6 of 23
Anonymous
in reply to: Anonymous

What you have works for me. Is there anything else that you need to set? I turn all that stuff off by default, so I can't guess what you need to do really, unless you check all the things that are in the "options->display->layout elements". The only one I have checked there is "Display model and layout tabs".

Sorry couldn't be more help, I'm A2K4.
Tim
Message 7 of 23
Anonymous
in reply to: Anonymous

The problem is, you can't set a value to LIMMIN or LIMMAX in A2K5. They're read only.

How can you set these values with lisp, is there another variable to change now ??
Message 8 of 23
Anonymous
in reply to: Anonymous

Hi jclaidler schrieb: > The below program works with AutoCAD 2000i, but not with AutoCAD 2005. How > can I get this to work with A2K5. Works for me in A2k5... are there reactors they try to modify the limits? Limits can't be changed under some circumstances (from Help): LIMMIN/LIMMAX is read-only when paper space is active and the paper background or paper margins are displayed. Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
Message 9 of 23
Anonymous
in reply to: Anonymous

I know. Thats why I'm doing this in the program before setting the limits.

(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) 'LayoutDisplayPaper 0)
(vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) 'LayoutDisplayMargins 0)
Message 10 of 23
Anonymous
in reply to: Anonymous

Hi jclaidler > I know. Thats why I'm doing this in the program before setting the limits. Ah... I see, seems to be a bug in A2k5. If you change this properties by code, they aren't active until you open/close the preferences dialog... ugly. Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
Message 11 of 23
Anonymous
in reply to: Anonymous

Yeah..seems like that.
Thanks for the help, from across the pond.
Message 12 of 23
Anonymous
in reply to: Anonymous

Actually, doing a REGEN after the code will update the display. But LIMMIN and LIMMAX still can't be changed via lisp. Keeps saying they are read-only.


Command: limmin
LIMMIN = -0.3404,-0.2082 (read only)
Cannot set LIMMIN when paper margins or background are displayed.

Command: limmax
LIMMAX = 36.3692,24.2649 (read only)
Cannot set LIMMAX when paper margins or background are displayed.
Message was edited by: jclaidler
Message 13 of 23
Anonymous
in reply to: Anonymous

looks like you have to accomplish it this way....

(command "limits" (getvar "extmin") (getvar "extmax"))
Message 14 of 23
Anonymous
in reply to: Anonymous

Hi jclaidler > Actually, doing a REGEN after the code will update the display. But LIMMIN > and LIMMAX still have be changed via lisp. Yeah, made this try also: (vla-Regen *ActDoc* acAllViewports) but doesn't change anything except updating the display...>8-( Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
Message 15 of 23
Anonymous
in reply to: Anonymous

This is a pretty bad bug. I still can't change the limits, even by doing this:

(command "limits" (getvar "extmin") (getvar "extmax"))
Message 16 of 23
Anonymous
in reply to: Anonymous

This entire topic begs the question: why bother? Why not simply plot using the Layout option and stop worrying about setting limits? We haven't had trouble plotting since AutoCAD 2000, but then, we dropped all our old ways of plotting and jumped on to the Layout bandwagon. Sure has made our life easier in the long run. But thanks for highlighting the bug, I guess... ;^) -- R. Robert Bell "jclaidler" wrote in message news:21954043.1092683121177.JavaMail.jive@jiveforum2.autodesk.com... The below program works with AutoCAD 2000i, but not with AutoCAD 2005. How can I get this to work with A2K5. Thanks. (vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) "LayoutDisplayPaper" 0) (vlax-put (vla-get-display (vla-get-preferences (vlax-get-acad-object))) "LayoutDisplayMargins" 0)
Message 17 of 23
Anonymous
in reply to: Anonymous

ok.. here it is.

We plot by EXTENTS. But our German parent company plots by limits. When they plot our drawings, they get bad plots because we don't set limits in paperspace.

What I want is to setup AutoCAD to automatically set the limits when we open a drawing.

I have this already for AutoCAD 2000i, but AutoCAD 2005 won't allow this to work.

ok ?
Message was edited by: jclaidler
Message 18 of 23
Anonymous
in reply to: Anonymous

Well, if both of your firms converted to Layouts, the issue would go away. Is that ok with you? ;^) -- R. Robert Bell "jclaidler" wrote in message news:10779318.1092771882565.JavaMail.jive@jiveforum2.autodesk.com... ok.. here it is. We plot by EXTENTS. But our German parent company plots by limits. When the go to plot our drawings, they get bad plots because we don't set limits in paperspace. What I want is to setup AutoCAD to automatically set the limits when we open a drawing. Is this ok with you ??
Message 19 of 23
Anonymous
in reply to: Anonymous

Actually, no. The people in our German company will never change there ways. They're too stubborn. lol

This would be the easiest way, and both 'firms' wouldn't have to change a thing. It was hard enougth to get the firm i work for to adopt paper space.
Message was edited by: jclaidler
Message 20 of 23
Anonymous
in reply to: Anonymous

hi jclaidler, is there a chance to use one of your drawings... a simple one if you can... i want to make a test., just drop it on the customer-files. thanks. > Actually, no. The people in our German company will never change there ways. They're too stubborn. lol > > This would be the easiest way, and both 'firms' wouldn't have to change a thing. It was hard enougth to get 'my company' to adopt paper space.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost