×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Toggle between multiple view ports
2

Toggle between multiple view ports

Toggle between multiple view ports

(OP)
ok i know this much the hotkey commnad is
CTRL+R that toggles thru the viewports ok
the command i think it uses is this
CVPORTS and whatever its variable is set to thats what vport is set as current
but if your not in a vport it returns an error so what im propossing to do is this create a button macro so that you can do the same as the CTRL+R hotkey set
im thinking the macro should start out something like this

^C^CMS;cvport;1;
but this is all well and good but im wanting to incrementally set this and also start at number one when first implemented so what the macro should do is this
1 change to model space
2 start the CVPORT command
3 look to see if cvport has been used and if so start
  at vport no.1
4 incremintally add 1 to the CVPORT setting but restart
  at 1 when the number of vports has been reached

If i figure out how to do this via a button macro ill post it here but if someone thinks that it can't be done this way and a lisp would have to be written then i guess for now im out of luck till i learn lisp or someone does it for me but even if i could just get some hints cause i know in button macros i can use some of the lisp functions

RE: Toggle between multiple view ports

A few lines of LISP will take care of most of your requirements:

; TVP.lsp - Viewport Toggling LISP Routine    

(DEFUN C:TVP()
  
(if (= (getvar "TILEMODE") 1)(setvar "TILEMODE" 0))
(command "MSPACE")
(setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))                       
(setq numvports (sslength ss1))
(if (< (getvar "CVPORT") numvports)  
  (setvar "CVPORT" (1+ (getvar "CVPORT")))  
  (setvar "CVPORT" 2)
)

(princ)                      

)

This routine can be initiated from model space or paper space, and also when tilemode is set to 1.

If you want to ensure that you start at viewport 1 the first time, the best way to do it is by initializing CVPORT in the acad.lsp file, not in this routine.  Also note that viewport 1 is the paper space viewport - model space viewports begin at 2 and increment from there.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources