Jump to content

Recommended Posts

Posted

Possible to move or copy an element e.g. viewport boundary from paperspace to modelspace and vice versa?

Posted

Objects can be moved from between the two spaces (model and paper) via the Change Space command. Type CHSPACE at the command line, hit the Enter key and pay attention to what AutoCAD asks you.

Posted

I don't think it is possible to do that with the actual viewport boundary, you could draw around the boundary and use chspace on that object

Posted

Nope, you cannot move a viewport and you can only move objects in one direction, from paper space to model space. Try it the other way round and you will get an error message

** Command not allowed in Model Tab **
. I use it to get the extents of the viewport into model space with multiple paper space viewports. All objects that are transferred are scaled
1 object(s) changed from PAPER space to MODEL space.

Objects were scaled by a factor of 0.170901730421261 to maintain visual

appearance.

Posted

You can move objects from model to paperspace, you just have to do it through a paperspace viewport (you cannot do it from the model space tab) and they scale to the viewport scale factor

Posted
You can move objects from model to paperspace, you just have to do it through a paperspace viewport (you cannot do it from the model space tab) and they scale to the viewport scale factor

 

Nice one steven, I didn't know that. I basically use paper space for plotting, so the only things on it are the border, title block and legend. I've also never needed to do it that way either, but it has opened up a few possibilities. Thanks :thumbsup: :beer:

Posted
I use it to get the extents of the viewport into model space
That's exactly what I wanted - so in paperspace you have to draw a rectangle over the viewport and CHSPACE that?
Posted
That's exactly what I wanted - so in paperspace you have to draw a rectangle over the viewport and CHSPACE that?

 

Correct. If it's a rectangular view port with two clicks you drop a rectangle over it and then move it to model space. If it's an irregular view port trace over the extents of the view port with a polyline and then move that. It's very neat when you have overlapping View ports and when they are not parallel or the same size.

Posted

There is a way to draw paperspace viewport outline in modelspace. I did use it to lineup some stuff in modelspace.

;;; vpo.lsp
;;;
;;; Creates a polyline in modelspace that
;;; has the outline of the selected viewport.
;;; Supports clipped viewports. polyline is supported
;;; ellipse, spline, region and circle not supported at this point
;;; If vp-outline is called when in mspace it detects
;;; the active viewport.
;;;
;;; c:vpo
;;;
;;; By Jimmy Bergmark
;;; Copyright (C) 1997-2008 JTB World, All Rights Reserved
;;; Website: [url="http://www.jtbworld.com"]www.jtbworld.com[/url]
;;; E-mail: [email="info@jtbworld.com"]info@jtbworld.com[/email]
;;;
;;; 2000-04-10
;;; 2003-11-19 Added support for drawing the outline in other ucs/view than world/current
;;;
;;; 2006-04-06 Added support for twisted views Tom Beauford
;;;
;;; Tested on AutoCAD 2000, 2000i, 2002, 2004, 2006, 2007, 2008, 2009
(vl-load-com)
(defun dxf (n ed) (cdr (assoc n ed)))
(defun ax:List->VariantArray (lst)
 (vlax-Make-Variant
   (vlax-SafeArray-Fill
     (vlax-Make-SafeArray
       vlax-vbDouble
       (cons 0 (- (length lst) 1))
     )
     lst
   )
 )
)
(defun c:vpo (/ ad ss ent pl plist xy n vpbl vpur msbl msur ven vpno ok)
 (setq ad (vla-get-activedocument (vlax-get-acad-object)))
 (if (= (getvar "tilemode") 0)
   (progn
     (if (= (getvar "cvport") 1)
       (progn
         (if (setq ss (ssget ":E:S" '((0 . "VIEWPORT"))))
           (progn
             (setq ent (ssname ss 0))
             (setq vpno (dxf 69 (entget ent)))
             (vla-Display (vlax-ename->vla-object ent) :vlax-true)
             (vla-put-mspace ad :vlax-true) ; equal (command "._mspace")
             ; this to ensure trans later is working on correct viewport
             (setvar "cvport" vpno)
;              (vla-put-mspace ad :vlax-false) ; equal (command "._pspace")
             (setq ok T)
           )
         )
       )
       (setq ent (vlax-vla-object->ename (vla-get-activepviewport ad))
             ok  T
       )
     )
     (if ok
       (progn
         (setq ven (vlax-ename->vla-object ent))
         (if (/= 1 (logand 1 (dxf 90 (entget ent)))) ; detect perspective
           (if (= (vla-get-clipped ven) :vlax-false)
              (progn                 ; not clipped
                (vla-getboundingbox ven 'vpbl 'vpur)
                  (setq vpbl  (trans (vlax-safearray->list vpbl) 3 2)
                        msbl  (trans vpbl 2 1)
                        msbl  (trans msbl 1 0)
                        vpur  (trans (vlax-safearray->list vpur) 3 2)
                        msur  (trans vpur 2 1)
                        msur  (trans msur 1 0)
                        vpbr (list (car vpur) (cadr vpbl)0)
                        msbr  (trans vpbr 2 1)
                        msbr  (trans msbr 1 0)
                        vpul (list (car vpbl) (cadr vpur)0)
                        msul  (trans vpul 2 1)
                        msul  (trans msul 1 0)
                        plist (list (car msbl) (cadr msbl)
                                           (car msbr) (cadr msbr)
                                           (car msur) (cadr msur)
                                           (car msul) (cadr msul)
                                    )
                   )
              )
              (progn                 ; clipped
                (setq pl    (entget (dxf 340 (entget ent)))
                      plist (vla-get-coordinates
                              (vlax-ename->vla-object (dxf -1 pl))
                            )
                      plist (vlax-safearray->list (vlax-variant-value plist))
                      n     0
                      pl    nil
                )
                (repeat (/ (length plist) 2)
                  (setq xy (trans (list (nth n plist) (nth (1+ n) plist)) 3 2)
                        xy  (trans xy 2 1)
                        xy  (trans xy 1 0)
                        pl (cons (car xy) pl)
                        pl (cons (cadr xy) pl)
                        n  (+ n 2)
                  )
                )
                (setq plist (reverse pl))
              )
           )
         )
         (setq plist (ax:List->VariantArray plist))
         (vla-Put-Closed
           (vla-AddLightWeightPolyline
             (vla-get-ModelSpace ad)
             plist
           )
           :vlax-True
         )
       )
     )
   )
 )
 (if ss(vla-put-mspace ad :vlax-false)) ; equal (command "._pspace"))
 (princ)
)

Posted
There is a way to draw paperspace viewport outline in modelspace. I did use it to lineup some stuff in modelspace.

;;; vpo.lsp
;;;
;;; Creates a polyline in modelspace that
;;; has the outline of the selected viewport.
;;; Supports clipped viewports. polyline is supported
;;; ellipse, spline, region and circle not supported at this point
;;; If vp-outline is called when in mspace it detects
;;; the active viewport.
;;;
;;; c:vpo
;;;
;;; By Jimmy Bergmark
;;; Copyright (C) 1997-2008 JTB World, All Rights Reserved
;;; Website: [url="http://www.jtbworld.com"]www.jtbworld.com[/url]
;;; E-mail: [email="info@jtbworld.com"]info@jtbworld.com[/email]
;;;
;;; 2000-04-10
;;; 2003-11-19 Added support for drawing the outline in other ucs/view than world/current
;;;
;;; 2006-04-06 Added support for twisted views Tom Beauford
;;;
;;; Tested on AutoCAD 2000, 2000i, 2002, 2004, 2006, 2007, 2008, 2009
(vl-load-com)
(defun dxf (n ed) (cdr (assoc n ed)))
(defun ax:List->VariantArray (lst)
 (vlax-Make-Variant
   (vlax-SafeArray-Fill
     (vlax-Make-SafeArray
       vlax-vbDouble
       (cons 0 (- (length lst) 1))
     )
     lst
   )
 )
)
(defun c:vpo (/ ad ss ent pl plist xy n vpbl vpur msbl msur ven vpno ok)
 (setq ad (vla-get-activedocument (vlax-get-acad-object)))
 (if (= (getvar "tilemode") 0)
   (progn
     (if (= (getvar "cvport") 1)
       (progn
         (if (setq ss (ssget ":E:S" '((0 . "VIEWPORT"))))
           (progn
             (setq ent (ssname ss 0))
             (setq vpno (dxf 69 (entget ent)))
             (vla-Display (vlax-ename->vla-object ent) :vlax-true)
             (vla-put-mspace ad :vlax-true) ; equal (command "._mspace")
             ; this to ensure trans later is working on correct viewport
             (setvar "cvport" vpno)
;              (vla-put-mspace ad :vlax-false) ; equal (command "._pspace")
             (setq ok T)
           )
         )
       )
       (setq ent (vlax-vla-object->ename (vla-get-activepviewport ad))
             ok  T
       )
     )
     (if ok
       (progn
         (setq ven (vlax-ename->vla-object ent))
         (if (/= 1 (logand 1 (dxf 90 (entget ent)))) ; detect perspective
           (if (= (vla-get-clipped ven) :vlax-false)
              (progn                 ; not clipped
                (vla-getboundingbox ven 'vpbl 'vpur)
                  (setq vpbl  (trans (vlax-safearray->list vpbl) 3 2)
                        msbl  (trans vpbl 2 1)
                        msbl  (trans msbl 1 0)
                        vpur  (trans (vlax-safearray->list vpur) 3 2)
                        msur  (trans vpur 2 1)
                        msur  (trans msur 1 0)
                        vpbr (list (car vpur) (cadr vpbl)0)
                        msbr  (trans vpbr 2 1)
                        msbr  (trans msbr 1 0)
                        vpul (list (car vpbl) (cadr vpur)0)
                        msul  (trans vpul 2 1)
                        msul  (trans msul 1 0)
                        plist (list (car msbl) (cadr msbl)
                                           (car msbr) (cadr msbr)
                                           (car msur) (cadr msur)
                                           (car msul) (cadr msul)
                                    )
                   )
              )
              (progn                 ; clipped
                (setq pl    (entget (dxf 340 (entget ent)))
                      plist (vla-get-coordinates
                              (vlax-ename->vla-object (dxf -1 pl))
                            )
                      plist (vlax-safearray->list (vlax-variant-value plist))
                      n     0
                      pl    nil
                )
                (repeat (/ (length plist) 2)
                  (setq xy (trans (list (nth n plist) (nth (1+ n) plist)) 3 2)
                        xy  (trans xy 2 1)
                        xy  (trans xy 1 0)
                        pl (cons (car xy) pl)
                        pl (cons (cadr xy) pl)
                        n  (+ n 2)
                  )
                )
                (setq plist (reverse pl))
              )
           )
         )
         (setq plist (ax:List->VariantArray plist))
         (vla-Put-Closed
           (vla-AddLightWeightPolyline
             (vla-get-ModelSpace ad)
             plist
           )
           :vlax-True
         )
       )
     )
   )
 )
 (if ss(vla-put-mspace ad :vlax-false)) ; equal (command "._pspace"))
 (princ)
)

 

Jimmy writes some useful stuff at times. But with the command CHSPACE it seems a little superfluous this time.

Posted

Yeah I make a copy of my whole schematic 1:50 building section, then tart up just the bits of it that are needed for 1:5 details - and it's good to know (in modelspace) what the boundary (viewport) of each tart-up zone is.

 

Thanks for rapid, clear and explanatory replies, as always. I miss that so much, spending most time on the Bentley (Microstation) forum, which is v different. If only CadTutor had a MS section.

Posted
Yeah I make a copy of my whole schematic 1:50 building section, then tart up just the bits of it that are needed for 1:5 details - and it's good to know (in modelspace) what the boundary (viewport) of each tart-up zone is.

 

Thanks for rapid, clear and explanatory replies, as always. I miss that so much, spending most time on the Bentley (Microstation) forum, which is v different. If only CadTutor had a MS section.

 

There is...MicroStation

Posted

Oh, so it does - right then!

Posted
Nice one steven, I didn't know that. I basically use paper space for plotting, so the only things on it are the border, title block and legend. I've also never needed to do it that way either, but it has opened up a few possibilities. Thanks :thumbsup: :beer:
Bitte , Been a while since I used it , but I used to do something similar to the OP, it is sometimes easier to know what size your paperspace viewport is and then move things within a boundary in model space.
Posted

This feed has been very useful - thanks for the question fostertom! and all those that gave input to it. :D

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