Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Mentor
Lineabove
Posts: 228
Registered: ‎06-30-2008
Message 1 of 11 (308 Views)
Accepted Solution

Navigate Viewports

308 Views, 10 Replies
01-11-2013 08:13 AM

Would anyone be able to suggest a lisp (or keystrokes) to navigate thru multiple Viewports ?

 

When I am in Paper Space and have numerous Viewports, I would like to be able to use a lisp (or keystrokes) to navigate to the next Viewport or the previous Viewport.

 

Any suggestions would be appreciated.

 


Lineabove wrote:

 

I used the term "Viewports" where I actually meant "TABS".

 .......

Currently I have a drawing with 19 Tabs, and each Tab has a descriptive label, ie: "A-05 Roof Plan"

 ......

What I was hoping for was a key combination or lisp that would do nothing more than make the next (or previous) Layout Tab current, so ideally I could just click, click, click to navigate the LayoutTabs.


 

I think theres one out there  that do just that.  try to do a google search or on this forum for Toggle Layout Tab. If you cant find a code you like , then i'll write you one for you.

 

I just remember, a couple of post ago,  somebody requested for layout order  and the OP was directed to this site

 

TabSort by Lee Mac  <----- 

 

One of its features is "current button: Makes the selected Tab the Current Drawing Layout

 

HTH

*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 2 of 11 (308 Views)

Re: Navigate Viewports

01-11-2013 08:24 AM in reply to: Lineabove

Lineabove wrote:

....(or keystrokes) to navigate thru multiple Viewports ?....

 .

Any suggestions would be appreciated.

 


 

Ctrl+R 

Mentor
Lineabove
Posts: 228
Registered: ‎06-30-2008
Message 3 of 11 (300 Views)

Re: Navigate Viewports

01-11-2013 09:28 AM in reply to: pbejse

But what macro is associated with CTRL+R ?

 

*Expert Elite*
hmsilva
Posts: 3,022
Registered: ‎12-17-2004
Message 4 of 11 (280 Views)

Re: Navigate Viewports

01-11-2013 02:29 PM in reply to: Lineabove

Lineabove,

the system variable, that activates the viewport is CVPORT, if you type

 

Command: CVPORT

Enter new value for CVPORT <2>:

 

if you enter 3, it will activate the 'next viewport, if there are more than one,

 

Note that CVPORT 1, is if none viewport is active.

 

another approach, is to create a button in the tool palettes,

and in the command string just type   ^V

it will cycles all viewports.

 

Hope that helps

 

Henrique

Mentor
Lineabove
Posts: 228
Registered: ‎06-30-2008
Message 5 of 11 (278 Views)

Re: Navigate Viewports

01-11-2013 02:33 PM in reply to: Lineabove

Thank you.

 

*Expert Elite*
hmsilva
Posts: 3,022
Registered: ‎12-17-2004
Message 6 of 11 (271 Views)

Re: Navigate Viewports

01-11-2013 02:54 PM in reply to: Lineabove

Lineabove,
perhaps something like

 

(defun c:test (/ num vp)
  (setq	num (sslength (ssget "x"
			     (list (cons 0 "VIEWPORT")
				   (cons 410 (getvar "ctab"))
			     )
		      )
	    )
  )
(if (= (setq vp (getvar "CVPORT")) num) (setvar "CVPORT" 2) (setvar "CVPORT" (+ vp 1)) );; if (princ) )

 

 

Henrique

*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 7 of 11 (244 Views)

Re: Navigate Viewports

01-12-2013 07:54 AM in reply to: Lineabove

Lineabove wrote:

But what macro is associated with CTRL+R ?

 


 

Lineabove, let's say we play along. I think i have an idea how to do handle "Previous" and "next". How may viewports are we dealing with here? are these randomly created viewports? no order at all? 

 

I'm more curious on how or to what are you planning to use the macro/lisp ?  Can you be so kindly and explain more about this to us.

 

Cheers

 

 

Mentor
Lineabove
Posts: 228
Registered: ‎06-30-2008
Message 8 of 11 (238 Views)

Re: Navigate Viewports

01-12-2013 08:30 AM in reply to: Lineabove

I made a horrendous error in my original description and I apologize to those kind members who took the time to reply. My bad.

 

I used the term "Viewports" where I actually meant "TABS".

 

Currently I have a drawing with 19 Tabs, and each Tab has a descriptive label, ie: "A-05 Roof Plan"

 

I am trying to train myself to not have the Layout and Model Tabs visible so that I gain a little more screen real estate.

Also, when I use the QuickView Layouts button I will see the thumbnails but I usually need to scroll towards the end.

 

I do know that the command is CTAB and that I can enter a new value ie: "A-02.1 Basement Plan".

(A lot of typing to change TABS - too bad there is not a drop down list you could select from).

 

What I was hoping for was a key combination or lisp that would do nothing more than make the next (or previous) Layout Tab current, so ideally I could just click, click, click to navigate the LayoutTabs.

*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 9 of 11 (231 Views)

Re: Navigate Viewports

01-12-2013 08:58 AM in reply to: Lineabove

Lineabove wrote:

 

I used the term "Viewports" where I actually meant "TABS".

 .......

Currently I have a drawing with 19 Tabs, and each Tab has a descriptive label, ie: "A-05 Roof Plan"

 ......

What I was hoping for was a key combination or lisp that would do nothing more than make the next (or previous) Layout Tab current, so ideally I could just click, click, click to navigate the LayoutTabs.


 

I think theres one out there  that do just that.  try to do a google search or on this forum for Toggle Layout Tab. If you cant find a code you like , then i'll write you one for you.

 

I just remember, a couple of post ago,  somebody requested for layout order  and the OP was directed to this site

 

TabSort by Lee Mac  <----- 

 

One of its features is "current button: Makes the selected Tab the Current Drawing Layout

 

HTH

Mentor
Lineabove
Posts: 228
Registered: ‎06-30-2008
Message 10 of 11 (224 Views)

Re: Navigate Viewports

01-12-2013 09:30 AM in reply to: Lineabove

EXCELLENT !

 

Thank you.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.