Ohnoto Posted May 11, 2011 Posted May 11, 2011 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. Quote
BlackBox Posted May 11, 2011 Posted May 11, 2011 (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 May 11, 2011 by BlackBox Typo Quote
Ohnoto Posted May 12, 2011 Author Posted May 12, 2011 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. Quote
BlackBox Posted May 12, 2011 Posted May 12, 2011 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? Quote
Ohnoto Posted May 12, 2011 Author Posted May 12, 2011 When I added it to my own, putting my code where you specified. Quote
BlackBox Posted May 12, 2011 Posted May 12, 2011 When I added it to my own, putting my code where you specified. ... and that code would be? Quote
Recommended Posts
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.