Jump to content

Lower point left and upper point right


ipse

Recommended Posts

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...
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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 9 years later...

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 by seakone
Link to comment
Share on other sites

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.

 

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