Jump to content

Recommended Posts

Posted

Is there a way to select specific blocks or objects only visible within a current viewport, possibly using a trans function, but where viewtwists are at different angles and viewports are not always the same shape or size?

 

What I am trying to do is perform rotation actions to specific blocks, which I can do already with code I have, and I can do a foreach sslength layoutlist to perform the action on each page, it's the selecting only whats within the viewports I'm wondering about.

 

Thanks.

Posted (edited)

Yes this can be done either using trans, or the TranslaterCoordinates Method.

 

Assuming you only have a single viewport for each layout, you could use this (as the tab is changed):

 

(if
 (and
   (setq ss
          (ssget "_x"
                 (list '(0 . "VIEWPORT")
                       (cons 410 (getvar 'ctab))
                       '(-4 . "<NOT")
                       '(69 . 1)                                       ; <-- Ignore pviewport 
                       '(-4 . "NOT>")
                       )
                 )
         )
   (setq eName (ssname ss 0))
   )
 [color=blue];; <-- Your code here[/color]
 )

Edited by BlackBox
Typo
Posted

Thanks for the quick reply. I got an error stating "too many arguments". Not sure if it's due to other " if " statements further in the coding or something with what you posted there.

 

And your assumption was correct, that there is only one viewport per page.

Posted
Thanks for the quick reply. I got an error stating "too many arguments". Not sure if it's due to other " if " statements further in the coding or something with what you posted there.

 

And your assumption was correct, that there is only one viewport per page.

 

To clarify, did you receive the error when adding the code I posted to your own code, or when testing my code alone?

Posted

When I added it to my own, putting my code where you specified.

Posted
When I added it to my own, putting my code where you specified.

 

... and that code would be? :unsure:

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...