EXTMIN and EXTMAX system variable issue

EXTMIN and EXTMAX system variable issue

Anonymous
Not applicable
1,399 Views
4 Replies
Message 1 of 5

EXTMIN and EXTMAX system variable issue

Anonymous
Not applicable
I am using some VBA code to check that a frame in paperspace is the correct size before printing to a pre-determined printer. Normally frames are placed with the lower left corner at 0,0 and so the upper right corner represents the size of the paper. My code uses EXTMIN and EXTMAX system variables, and works fine... most of the time. But for some strange reason, on a rare occasion my EXTMAX and EXTMIN system variables are inaccurate by about -0.05mm. Then, when i switch from paperspace to modelspace and then back again it is perfect - as it should be.
0 Likes
1,400 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Just to update, I have managed to norrow down some things on this issue. I believe it to be somehow related to zoom-extents.

Glance over this sequence of commands:

Command: extmin

EXTMIN = 0.0000,0.0000,0.0000 (read only)
Command: '_.zoom _e
Command: extmin

EXTMIN = -0.0257,-0.0181,-0.0015 (read only)
Command: *Cancel*

Command: *Cancel*

Command:
Regenerating model.

Command: *Cancel*

Command: *Cancel*

Command:
Regenerating layout.
Regenerating model.

Command: extmin

EXTMIN = 0.0000,0.0000,0.0000 (read only)

I really dont get why extmin value changes after zoom extents. Anyone have an idea?

Thanks
RaNDoM
0 Likes
Message 3 of 5

Anonymous
Not applicable
Anybody have any idea how I can save these system variables in VBA code?

I keep getting a type mismatch error. What variable type is it expecting?

Same problem with system variable SNAPUNIT

Disregard as I have figured out how to do it. Message was edited by: cmb24
0 Likes
Message 4 of 5

raghumanevarthe
Community Visitor
Community Visitor
(defun c:extminmax()
  (vla-zoomextents (vlax-get-acad-object))
  (vl-cmdf "point" (getvar "EXTMIN"))
  (setq point1 (entlast))
  (vl-cmdf "point" (getvar "EXTMAX"))
  (setq point2 (entlast))
  (setq pt1ins (cdr (assoc 10 (entget point1))))
  (setq pt3ins (cdr (assoc 10 (entget point2))))
)
0 Likes
Message 5 of 5

Ed__Jobe
Mentor
Mentor

First of all, this is a VBA forum. The post requested how to set the variable using VBA, not lisp. Second, those sysvars are read-only. You can't set them directly. They simply report the extents of the contents of modelspace. You have to change what's stored in modelspace to change the variables.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes