ipse Posted July 27, 2012 Share Posted July 27, 2012 How to find these points for using them in a lisp? I can't find... Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 27, 2012 Share Posted July 27, 2012 What are those points you were talking about? You have a list of points, the vertexes of a polyline, the corners of a viewport or the screen, or is about other situation? You need to give us more information in order to get a good answer. And, by the way, welcome to the Forum! Quote Link to comment Share on other sites More sharing options...
ipse Posted July 27, 2012 Author Share Posted July 27, 2012 Corners of a viewport or the screen. Sorry for speed... Do you know why this is working (ssget "_x"(list '(0 . "INSERT") '(2 . "NUMBER")(setq tab (cons 410 (getvar 'ctab))))) and this one is not working? (ssget "_x"(list '(0 . "INSERT") '(2 . "TABLE 1")(setq tab (cons 410 (getvar 'ctab))))) May be the space between TABLE AND 1? It's a dynamic block...maybe this is the reason? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2012 Share Posted July 27, 2012 Corners of a viewport or the screen. Consider this function: ;; Viewport Extents - Lee Mac ;; Returns two WCS points describing the lower-left and ;; upper-right corners of the active viewport. (defun LM:ViewportExtents ( / a c h v ) (setq h (/ (getvar 'viewsize) 2.0) a (apply '/ (getvar 'screensize)) v (list (* h a) h) c (trans (getvar 'viewctr) 1 0) ) (list (mapcar '- c v) (mapcar '+ c v)) ) It's a dynamic block...maybe this is the reason? Yes, references of a dynamic block become anonymous when the Dynamic Block properties (e.g. Visibility State) are altered following insertion. You will either need to retrieve a selection set consisting of blocks with the required name and all anonymous block references, then iterate over this set and remove those references whose Effective Name does not match the required block name; or, use this alternative method. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 27, 2012 Share Posted July 27, 2012 ipse, Please read the CODE POSTING GUIDELINES and edit your post to incclude code tags. Quote Link to comment Share on other sites More sharing options...
wishbonesr Posted September 4, 2012 Share Posted September 4, 2012 Consider this function: Lee (or anybody in the know), What's your thoughts on activeX with center, height, & width? I've noticed that the activeviewport object doesn't reflect really a view state until after tilemode is toggled to and fro. Is there a way to update the activeviewport object to have the latest view settings - or is the best way simply to get vars as in your example and give up on the activeX object? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 4, 2012 Share Posted September 4, 2012 Lee (or anybody in the know), What's your thoughts on activeX with center, height, & width? I've noticed that the activeviewport object doesn't reflect really a view state until after tilemode is toggled to and fro. Is there a way to update the activeviewport object to have the latest view settings - or is the best way simply to get vars as in your example and give up on the activeX object? The ActiveX Viewport properties are cached until the layout is switched and the properties are updated (note the command-line message: "Restoring cached viewports."), however, the System Variables referenced in my earlier post are updated in real-time. Furthermore, the method implemented in my code will work for both Modelspace Viewports and Paperspace PViewports, whereas these are different objects in ActiveX. Quote Link to comment Share on other sites More sharing options...
seakone Posted December 6, 2021 Share Posted December 6, 2021 (edited) And how can i get the corners if i have not TopView? I struggle.... I think something with trans 0 2 but at which point. Or do I have to calculate it on a other way? Edited December 6, 2021 by seakone Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 6, 2021 Share Posted December 6, 2021 I am a bit confused on what your trying to do. If you want the cords of a different view then your current one switch to it and run (LM:ViewportExtents) to get those cords. Quote Link to comment Share on other sites More sharing options...
seakone Posted December 7, 2021 Share Posted December 7, 2021 LOL Quote Link to comment Share on other sites More sharing options...
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.