ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Zoom Scale Factor

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
624 Views, 4 Replies

Zoom Scale Factor

Hi,
I have a raster image (tif, jpg, etc...).
I would like to show (load) it when Autocad Zoom scale factor is inside a
defined range and
unload it when outside a defined zoom scale factor.
Anyone have any idea how can I do that???

thanks,
Aragao
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

where is your problem?
-get the actual zoom scale factor
-get the event when the zoom scale factor has changed
-load/unload the image


Paulo Aragao schrieb:

> Hi,
> I have a raster image (tif, jpg, etc...).
> I would like to show (load) it when Autocad Zoom scale factor is inside a
> defined range and
> unload it when outside a defined zoom scale factor.
> Anyone have any idea how can I do that???
>
> thanks,
> Aragao
Message 3 of 5
Anonymous
in reply to: Anonymous

Hi,
Which reactor and member function fire an event when zoom scale factor is
changed???
This event is fired when I change Zoom Scale Factor using arx (don´t using
zoom AutoCAD command) ??
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.
Another question: How can I get my current lower left and upper right on
AutoCAD screen??

Thanks,
Aragao


"J. Schlingheider" escreveu na mensagem
news:3C147FAF.CCD26CD9@web.de...
> where is your problem?
> -get the actual zoom scale factor
> -get the event when the zoom scale factor has changed
> -load/unload the image
>
>
> Paulo Aragao schrieb:
>
> > Hi,
> > I have a raster image (tif, jpg, etc...).
> > I would like to show (load) it when Autocad Zoom scale factor is inside
a
> > defined range and
> > unload it when outside a defined zoom scale factor.
> > Anyone have any idea how can I do that???
> >
> > thanks,
> > Aragao
>
Message 4 of 5
diagodose2009
in reply to: Anonymous

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

 

Message 5 of 5
owenwengerd
in reply to: diagodose2009

The post you are replying to is over 10 years old, so I doubt that the original author is still following it.

--
Owen Wengerd
ManuSoft

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

Post to forums  

Autodesk Design & Make Report

”Boost