I have a question for masters of ACAD... So what I need is help with this or just an answer that this isn't possible... I've cobbled for a while on how to obtain width/height of current initial VIEW of ModelSpace Viewport... For instance if you press ctrl+1, tool palette of Property will pop up... Without selecting of any entity, only with just panning of rolling middle mouse wheel you can observe changes with width/height of viewport... Also if you type VIEW command you can see that main VIEW is "Current" and also in dialog box you can see almost the same width/height properties... So if this changing of those parameters is possible to monitor, how can it be done? Then after some time, I've actually tried to build reactor based on VIEWSIZE sys variable changing, but then comes my disappointment about this problem... I've figured that only user changeable sys vars can be monitored by sysvar reactor... All this was because of simple triggering REGEN command, so when working in ACAD and your mouse wheel zooming reaches very small or very big values - I mean when almost before message is displayed that maximum zoom is reached, I wanted to pass REGEN command to CAD automatically, so that user can rotate mouse wheel almost constantly without breaks in working... Of course this reactor will be fine if simple geometry was drawn during session, otherwise continuously regenerating drawing may slow or even crash session and working may become unpleasant... So I tried to create this reactor, so that when you activate it, you can also deactivate it after your task was completed with the same command... So is this after all possible? Not to mention that I can't even get entity that's containing width/height values of main VIEW/VIEWPORT...
Please, if you can provide some valuable info or maybe solution it would be great...
My code :
(defun c:regenreac nil (vl-load-com)
(setq vs (getvar 'viewsize))
(setq reactor (VLR-SysVar-Reactor nil '((:VLR-sysVarChanged . callbackfunction))))
(if (null x)
(progn
(prompt "\nSysvar reactor enabled...")
(setq x t)
)
(progn
(prompt "\nAll reactors disabled...")
(vlr-remove-all)
(setq vs nil x nil reactor nil)
)
)
(princ)
)
(defun callbackfunction ( react_obj lst )
(if (eq (car lst) "VIEWSIZE")
(if (or (> (getvar 'viewsize) (* 4.0 vs)) (< (getvar 'viewsize) (/ vs 4.0)))
(progn
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewport)
(setq vs (getvar 'viewsize))
)
)
)
)
Thanks, M.R.