Hi,
This event is fired when I change Zoom Scale Factor using arx (don´t using
zoom AutoCAD command) ??
Q:: Where can I get zoom scale factor?? I know that I have a system acad
variable, but I am not sure if this variable is changed when I change my
zoom using arx.
A1: You search in autocad SDK in this way:
a1) you moidfy (at linecommand) zoomScaleFactort at line command with a number (special)
(E.g. zoomScaleFactor= 1.012345678901234567890)
a2) you load the LISP :
(vl-load-com)
(setq o (if e (vlax-ename->vla-object e) o))
(setq rr (vlax-dump-object o T))
a3) you search the specially numnber 1.0123456789001234567890 in textscreen at line command
if (you found please finishned
a4)if not found, you search the specialliy nuimber wtih the command (entge(....)
if (you found please you can modifuy with lisp R14:
[code]
(defun c:imag_on-off ( / ent dxf_ent flag_display new_flag)
(while (not (setq ent (entsel "\nSelect an image: "))))
(setq dxf_ent (entget (car ent)))
(cond
((eq (cdr (assoc 0 dxf_ent)) "IMAGE")
(setq flag_display (cdr (assoc 70 dxf_ent)))
(if (zerop (boole 1 flag_display 1))
(setq new_flag (1+ flag_display))
(setq new_flag (1- flag_display))
)
(entmod (subst (cons 70 new_flag) (assoc 70 dxf_ent) dxf_ent))
)
(T
(princ "\nIsn't an image!")
)
)
(prin1)
)
[/code]
Q3 Another question: How can I get my current lower left and upper right on
AutoCAD screen??
A4: You porting from source autolisp to c++arx:
[code]
//Inf:2D space returns lower left and upper right coords of current view
//Out:sp:list ((..) (..))
(Defun dfn_view_pnts(/ a b c d x rr)
/*c2s: b=getvar("VIEWSIZE"),
c=car(getvar("SCREENSIZE")),
d=cadr(getvar("SCREENSIZE")),
a=b*c/d,
x=dfn_sysvar_viewctr(),
x=trans(x,1,2);
c=list( car(x)-(a/2.0),cadr(x)-(b/2.0),0.0),
d=list( car(x)+(a/2.0),cadr(x)+(b/2.0),0.0),
c=trans(c,2,1),
d=trans(d,2,1),
rr=list(c,d);
*/
rr)
(Defun dfn_sysvar_viewctr( / a rr)
/*c2s: a=ACRX_T("VIEWCTR"),
rr=dfn_var_ispoint(getvar(a));
*/
rr)
[/code]
PLEASE ATTACH HERE ONE FILE TESTING DEM0IMAGEDWG. in maximum autocad2007
I hope can help
The post you are replying to is over 10 years old, so I doubt that the original author is still following it.