Jump to content

Detect Two Views in Model


rcb007

Recommended Posts

I am trying to create an if statement to switch to two horizonal views within model.

If its not two views, create the two views, if not, leave it alone.

Not really having any luck.

 

(ai_tiledvp 2 "_H");; This is the command within the ribbon.

(if (= (ai_tiledvp 1) 0) (ai_tiledvp 2 "_H"))

 

Thanks for the help.

Link to comment
Share on other sites

This is a tough one. It looks like ai_tiledvp doesn't give you the status of the tiles. Oddly, I can't find an AutoLISP command that does.

 

You might use the vports command. It returns a list of current viewports, so all you need to check is the length of that list.

Link to comment
Share on other sites

Untested to give the number of viewports in a layout tab. It won't tell you how these are aligned though, you could just get the (ssget "X"..... as a variable, loop through the selection set and viewport coordinates to work out if they are longer than taller assuming if so they are horizontally aligned.

 

( - (sslength (ssget "X" (list (cons 0 "VIEWPORT")(cons 410 (getvar 'ctab))))) 1)

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...