Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Autolisp for drawing limits

315 views
Skip to first unread message

Teresa C

unread,
Apr 28, 1999, 3:00:00 AM4/28/99
to
Hi,
Can anyone tell me where I can find a sample autolisp file to detect and set
up the drawing limits (for an existing drawing) automatically ?
TIA

Teresa

Jon Fleming

unread,
Apr 29, 1999, 3:00:00 AM4/29/99
to
The existing drawing limits are found by:

(getvar "LIMMIN")
(getvar "LIMMAX")

If you want to set them, you must do it with a 2D point, not a 3D point:

(setq P1 (getpoint "\nPick a point for LIMMIN: "))
;; Convert to 2D
(setq P1 (list (car P1) (cadr P1)))
(setvar "LIMMIN" P1)

jrf

Teresa C

unread,
Apr 29, 1999, 3:00:00 AM4/29/99
to
Jason,

Thanks for the response. There's only one problem..
Autodesk seems to have changed the definition for both Extmin & Extmax in
R14.01.
Say we make a new drawing with only a rectangle ((0,0) to (544,368)) in it.
Check the Extmin & Extmax after issuing a Zoom Extend, and surprisingly we
find out that these two variables are not exactly (0,0) and (544,368). They
are off slightly.
Any way to work around?

Teresa

Jason Wang wrote in message <7g9sqm$p0...@adesknews2.autodesk.com>...
>Hi,
>pls try:
>;;//////////////////////////
>(defun c:autolmt( / a b )
> (command "zoom" "e")
> (setq a (getvar "EXTMIN")
> b (getvar "EXTMAX")
> )
> (setvar "LIMMIN" (reverse (cdr (reverse a))))
> (setvar "LIMMAX" (reverse (cdr (reverse b))))
> (princ)
>)
>
>;;\\\\\\\\\\\\\\\\\\\\\\\\\\
>Teresa C wrote in message <7g8jt9$nf...@adesknews2.autodesk.com>...


>>Hi,
>>Can anyone tell me where I can find a sample autolisp file to detect and
>set
>>up the drawing limits (for an existing drawing) automatically ?

>>TIA
>>
>>Teresa
>>
>>
>
>

Jay Tolbert

unread,
Apr 29, 1999, 3:00:00 AM4/29/99
to
Teresa,

This is due to the method AutoCAD is using the calculate the extents. You can
correct the error by setting ENTEXTs to 0 or 2. 1, which is the default,
results in small errors in some cases. Thanks to Owen's undocumented system
variables page (http://www.manusoft.com/acadexp.htm#SysVars) for the
description below.

ENTEXTS integer [0, 1, 2] R12 Controls drawing extents calculation.
0 : extents are calculated each time they're needed
(slower, but uses less memory).
1 : cache extents of each entity in short (2-byte) values
if possible (compromise between speed
and memory efficiency).
2 : cache extents of each entity as long (4-byte) values
(fastest extents calculations, but uses more
storage memory).

Jay Tolbert
Dickerson Engineering, Inc.

Jason Wang

unread,
Apr 30, 1999, 3:00:00 AM4/30/99
to
0 new messages