mview button help

Discussion in 'AutoCAD' started by dketchek, Mar 29, 2005.

  1. dketchek

    dketchek Guest

    I am trying to create a button that does the following:

    Makes a layer named "viewport" with color 255, linetype continuous, set to Noplot.
    Trigger the Mview command and pick my 2 corners of the rectangle.
    Sets the current layer back to what it was at the beginning of the routine.

    I have been able to do the layer manipulation with the following:

    ^C^C(setq exlay (getvar "clayer"));(command "layer" "m" "viewport" "c" "255" "" "l" "" "" "p" "n" "" "");(command "layer" "s" exlay "")

    I have been placing the following mview line before the last layer command:

    (command "mview" pause)

    When I insert in the above, it works up to the point that I create the mview on layer viewport, but does not set the layer back to the original current layer.

    Any help will be greatly appreciated.

    Don
     
    dketchek, Mar 29, 2005
    #1
  2. dketchek

    coachball8 Guest

    Change it to (setvar "clayer" exlay)
     
    coachball8, Mar 29, 2005
    #2
  3. dketchek

    dketchek Guest

    Thanks, but I have tried this as well, but after I draw in the mview rectangle, I still remain on layer "viewport".
     
    dketchek, Mar 29, 2005
    #3
  4. dketchek

    Matt W Guest

    Here ya go... Note the 2 \\ They indicate a pause for user input, in this
    case, the two corners of the mview.

    ^C^C(setq exlay (getvar "clayer"));(command "layer" "m" "viewport" "c" "255"
    "" "l" "" "" "p" "n" "" "");mview;\\(command "layer" "s" exlay "");
     
    Matt W, Mar 29, 2005
    #4
  5. dketchek

    coachball8 Guest

    Nice catch....Thanks.
     
    coachball8, Mar 29, 2005
    #5
  6. dketchek

    dketchek Guest

    Thanks a million!

    Don
     
    dketchek, Mar 29, 2005
    #6
  7. dketchek

    Matt W Guest

    You're welcome.
     
    Matt W, Mar 29, 2005
    #7
  8. dketchek

    dketchek Guest

    By the way, what does the ^m signify in your routine?

    Don
     
    dketchek, Mar 29, 2005
    #8
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.