Adjusting opened drawings windowsize

Discussion in 'AutoCAD' started by Marcel Janmaat, Dec 15, 2004.

  1. Ok I get it! Thanx!
    The question now only is, how do I translate the extents size to pixels.

    M
     
    Marcel Janmaat, Dec 15, 2004
    #21
  2. Marcel Janmaat

    Tom Smith Guest

    Nope!

    Yep! If the Acad window is adjusted to square and the drawing window within
    it is maximized, then the drawing window will also be square, and if you
    zoom to extents you'll see your whole drawing neatly fitting the window. You
    can manually resize the Acad window to suit your image, and it will
    automatically resize the maximized drawing window within it. This won't
    happen unless the drawing window is maximized within Acad.

    That's why people keep suggesting the same thing. If your drawing window is
    anything OTHER than maximized within the Acad window, then you'll have to
    resize it again for every single file you open.

    If you leave the drawing window maximized within Acad, and control its
    proportion by resizing the overall Acad (application) window, then you only
    need to fiddle with the size once. Then you can bring up each file, zoom to
    its extents, and the sliedes will all be the same size and proportion..
     
    Tom Smith, Dec 15, 2004
    #22
  3. Marcel Janmaat

    Dann Guest

    Use 500 X 500 in the program, Then use Zoom Extents to fit to it.



    ps. You realize than now you are right where R. Robert Bell was trying to
    get to. ;)
     
    Dann, Dec 15, 2004
    #23
  4. Hello again,

    Unfortunatly te zoom command doesn't work after the (vla-put-Width adoc 840)
    and (vla-put-Height adoc 600)

    Here my code;

    (defun c:sld (/ sld)
    (ssv '("cmdecho" "filedia")) (setvar "cmdecho" 0) (setvar "filedia" 0)
    (setq sld (substring (strcat H_cadprg "sld\\" (getanm)) ".DWG" ".SLD"))
    (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-put-Width adoc (- (* (car (getvar "limmax")) 5) 60)) (vla-put-Height
    adoc (* (cadr (getvar "limmax")) 5)) ; It works fine till here
    (command "zoom" "w" (getvar "limmin") (getvar "limmax")) (command "mslide"
    sld); The zoom here doesn't have effect! Wich is strange because after
    zooming all "after" the SLD command it does zoom exactly to the windows
    size.
    ; Also tried zooming all twice. But with no luck.
    (princ (strcat "\nSlide " sld " is aangemaakt."))
    (rsv)
    (princ)
    )

    Maby you have an idea?

    M
     
    Marcel Janmaat, Dec 15, 2004
    #24
  5. Hello again,

    After some input on the subject, I came to this; (never mind the Dutch.)

    (defun c:sld (/ sld)
    (ssv '("cmdecho" "filedia")) (setvar "cmdecho" 0) (setvar "filedia" 0)
    (setq sld "Slidename.SLD")
    (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-put-Width adoc (- (* (car (getvar "limmax")) 5) 60)) (vla-put-Height
    adoc (* (cadr (getvar "limmax")) 5)) ; It works fine till here
    (command "zoom" "w" (getvar "limmin") (getvar "limmax")) (command "mslide"
    sld); The zoom here doesn't have effect! Wich is strange because after
    zooming all "after" the SLD command it does zoom exactly to the windows
    size.
    ; Also tried zooming all twice. But with no luck.
    (princ (strcat "\nSlide " sld " is aangemaakt."))
    (rsv)
    (princ)
    )

    Unfortunatly te zoom command doesn't work after the (vla-put-Width adoc 840)
    and (vla-put-Height adoc 600)

    Has any body got an idea on how to make it work??

    M
     
    Marcel Janmaat, Dec 20, 2004
    #25
  6. Marcel Janmaat

    Dann Guest

    Does this work for you?

    (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-put-Width adoc 840)
    (vla-put-Height adoc 600)
    (vla-sendcommand adoc "zoom ")
    (vla-sendcommand adoc "e ")


    The (command "zoom") didn't work for me either.
     
    Dann, Dec 20, 2004
    #26
  7. YES! Thanx! This works.

    Unfortunately I cannot find any help on the "vla-sendcommand".
    But found some on the internet.

    (vla-sendcommand adoc (strcat "zoom " "e ")) works aswell.

    Thanx again!

    M
     
    Marcel Janmaat, Dec 21, 2004
    #27
  8. Marcel Janmaat

    BillZ Guest

    Dann,

    For some reason tihs is Not working on my R2005.

    Code:
    (defun c:ButtonSlide ();(/ *acad* adoc sld Height Width)
    (vl-load-com)
    (setvar "cmdecho" 0)
    (setvar "filedia" 0)
    (setq sld "G:/temp/Slidename.SLD")
    (setq *acad* (vlax-get-acad-object)
    adoc (vla-get-ActiveDocument *acad*)
    acvp (vla-get-activeviewport adoc)
    Height (vla-get-height adoc)
    Width (vla-get-width adoc)
    ScWidth (* Width 0.5)
    )
    
    (vla-put-width adoc ScWidth)
    
    (vla-put-height adoc ScWidth)
    
    (vla-sendcommand adoc "zoom  ")
    
    (vla-sendcommand adoc "e ")
    
    (command "_.mslide" sld)
    (princ (strcat "\nSlide " sld " is created."))
    
    (vla-put-height adoc Height)
    (vla-put-width adoc Width)
    
    (setvar "cmdecho" 1)
    (setvar "filedia" 1)
    (princ)
    )
    Any Ideas?

    TIA

    Bill
     
    BillZ, Dec 21, 2004
    #28
  9. Marcel Janmaat

    BillZ Guest

    By not working I meant.

    The window is resizing but the zoom dowsn't seem to work and my slide is not scaled out to the extents when the mslide makes the slide (small slide).

    Bill
     
    BillZ, Dec 21, 2004
    #29
  10. Marcel Janmaat

    Dann Guest

    I noticed that you couldn't leave vlide open when running the program.
    When I switched to the AutoCAD graphics screen....Then it zoomed correctly
    on mine.
    Does it work if you run the lisp as a command?
     
    Dann, Dec 21, 2004
    #30
  11. Marcel Janmaat

    BillZ Guest

    Does it work if you run the lisp as a command?<<<

    No,
    I rarely use vlide and have executed the lisp from the command prompt.

    If I pause the program with a (getpoint) and use a transparent zoom e, then it works like it should.

    Bill
     
    BillZ, Dec 21, 2004
    #31
  12. Sorry to say it doesn't work for me aswell after all.

    The zoom command works ok, but it looks like the slide is being created
    before the zoom command.
    Wich shouldn't be posible should it?

    M

    Here my code;

    (defun c:sld (/ sld)
    (ssv '("cmdecho" "filedia")) (setvar "cmdecho" 0) (setvar "filedia" 0)
    (setq sld (substring (strcat H_cadprg "sld\\" (getanm)) ".DWG" ".SLD"))
    (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-put-Width adoc (- (* (fix (/ (car (getvar "limmax")) (getvar
    "dimscale"))) 5) 60))
    (vla-put-Height adoc (* (fix (/ (cadr (getvar "limmax")) (getvar
    "dimscale"))) 5))
    (vla-sendcommand adoc (strcat "zoom " "e "))
    ;(vla-sendcommand adoc (strcat "mslide \"" sld "\" ")) ; this didn't work!
    (command "mslide" sld)
    (princ (strcat "\nSlide " sld " is aangemaakt."))
    (rsv)
    (princ)
    )

    Never mind the Dutch!
     
    Marcel Janmaat, Dec 21, 2004
    #32
  13. <sigh> So why are you banging your head against this wall? Take the steps I
    outlined without using the ActiveX methods. Then you can use a simple script
    or vanilla lisp routine.

    --
    R. Robert Bell


    Sorry to say it doesn't work for me aswell after all.

    The zoom command works ok, but it looks like the slide is being created
    before the zoom command.
    Wich shouldn't be posible should it?
     
    R. Robert Bell, Dec 21, 2004
    #33
  14. Marcel Janmaat

    Tom Smith Guest

    <sigh>

    LOL But that would be easy, what's the challenge in that?
     
    Tom Smith, Dec 21, 2004
    #34
  15. Marcel Janmaat

    BillZ Guest

    Robert,

    I looked at your suggestion.

    The "Turn off all toolbars " is an adventure all by itself.

    I can turn them off if I put the visibility to false and I get a list so i know which ones to trun on, but when I turn them back on, they are not in the same positions anymore.

    Is there a different way to do it?

    Code:
    (vlax-for
    item MenGrps
    (setq names (cons (vla-get-name item) names))
    )
    
    (foreach n names
    (vlax-for item
    (vla-get-toolbars
    (vla-item MenGrps n))
    (if (= (vla-get-visible item) :vlax-true)
    (progn
    (setq VisList (cons item VisList))
    (vla-put-visible item :vlax-false)
    )
    )
    )
    )
    And then later in the program

    Code:
    (foreach n VisList
    (vla-put-visible n :vlax-true)
    )
    Bill
     
    BillZ, Dec 21, 2004
    #35
  16. Why automate it? Making slides is not an everyday task. Simply manually
    (gasp!) setup the environment, make the slides, and reset the environment
    manually (urk!) and forget about it until you need to make more slides a
    couple of years from now.

    --
    R. Robert Bell


    Robert,

    I looked at your suggestion.

    The "Turn off all toolbars " is an adventure all by itself.

    I can turn them off if I put the visibility to false and I get a list so i
    know which ones to trun on, but when I turn them back on, they are not in
    the same positions anymore.

    Is there a different way to do it?

    Code:
    (vlax-for
    item MenGrps
    (setq names (cons (vla-get-name item) names))
    )
    
    (foreach n names
    (vlax-for item
    (vla-get-toolbars
    (vla-item MenGrps n))
    (if (= (vla-get-visible item) :vlax-true)
    (progn
    (setq VisList (cons item VisList))
    (vla-put-visible item :vlax-false)
    )
    )
    )
    )
    And then later in the program

    Code:
    (foreach n VisList
    (vla-put-visible n :vlax-true)
    )
    Bill
     
    R. Robert Bell, Dec 22, 2004
    #36
  17. Marcel Janmaat

    BillZ Guest

    Why automate it? Making slides is not an everyday task. Simply manually
    (gasp!) setup the environment, make the slides, and reset the environment
    manually (urk!) and forget about it until you need to make more slides a
    couple of years from now.<<<

    Robert
    You're correct. I don't use slides alot and know how to do it (ugh) manually.
    But part of my job here is to learn customizing so I spend part of my day testing code and examinig the help files.
    I don't always come up with a successful program but I do learn something along the way.
    Who knows a couple of years from now I may not have to ask these kinds of questions. :)

    Thanks for the reply.

    Bill
     
    BillZ, Dec 22, 2004
    #37
  18. I'm not trying to denigrate your efforts to customize it. After all, you've
    discovered an interesting issue along the way, no? ;^)

    --
    R. Robert Bell


    (gasp!) setup the environment, make the slides, and reset the environment
    manually (urk!) and forget about it until you need to make more slides a
    couple of years from now.<<<

    Robert
    You're correct. I don't use slides alot and know how to do it (ugh)
    manually.
    But part of my job here is to learn customizing so I spend part of my day
    testing code and examinig the help files.
    I don't always come up with a successful program but I do learn something
    along the way.
    Who knows a couple of years from now I may not have to ask these kinds of
    questions. :)

    Thanks for the reply.

    Bill
     
    R. Robert Bell, Dec 22, 2004
    #38
  19. Marcel Janmaat

    BillZ Guest

    I'm not trying to denigrate your efforts to customize it. <<<

    I never took it that way.
    discovered an interesting issue along the way, no? ;^)<<<

    Yes indeed. :)

    Billy
     
    BillZ, Dec 22, 2004
    #39
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.