;;-------------------=={ Modelspace to Paperspace }==-------------------;;
;; ;;
;; This program allows the user to copy a selection of objects from ;;
;; Modelspace to Paperspace through an active viewport. ;;
;; ;;
;; This functionality is similar to the standard CHSPACE command, ;;
;; however, this program will copy the selection of objects as ;;
;; opposed to moving the objects from Modelspace to Paperspace. ;;
;; ;;
;; Upon issuing the command 'ms2ps' at the AutoCAD command-line, the ;;
;; user is prompted to make a selection of objects to copy. ;;
;; ;;
;; Following a valid selection, the program will copy the objects to ;;
;; the active Paperspace layout, before performing the necessary ;;
;; matrix transformations to maintain the visual appearance of the ;;
;; objects as displayed through the active viewport. ;;
;; ;;
;; The program is compatible with rectangular & polygonal viewports, ;;
;; under all UCS & view settings, and with objects constructed in ;;
;; any UCS construction plane. ;;
;; ;;
;; Note that the command is only available when a Paperspace Layout ;;
;; is set current, with a viewport active. ;;
;; ;;
;;----------------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2014 - www.lee-mac.com ;;
;;----------------------------------------------------------------------;;
;; Version 1.0 - 2014-02-16 ;;
;; ;;
;; First release. ;;
;;----------------------------------------------------------------------;;
(defun c:ms2ps
( / *error* ang doc enx idx lst mat nor scl sel
)
(LM:endundo (LM:acdoc))
)
)
(LM:startundo (LM:acdoc))
(prompt "\nCommand only available in Paperspace.") )
(prompt "\nPlease activate a viewport.") )
)
)
(setq mat
;; The following is adapted from gile's WCS2PCS function: (mxm
'(0.0 0.0 1.0)
)
'(
(1.0 0.0 0.0)
(0.0 1.0 0.0)
(0.0 0.0 1.0)
)
)
)
)
)
)
'((0.0 0.0 0.0 1.0))
)
)
)
)
)
)
)
)
)
(LM:endundo (LM:acdoc))
)
;; Matrix Transpose - Doug Wilson
;; Args: m - nxn matrix
)
;; Matrix x Matrix - Vladimir Nesterovsky
;; Args: m,n - nxn matrices
)
;; Matrix x Vector - Vladimir Nesterovsky
;; Args: m - nxn matrix, v - vector in R^n
)
;; Vector x Scalar - Lee Mac
;; Args: v - vector in R^n, s - real scalar
)
;; Start Undo - Lee Mac
;; Opens an Undo Group.
(defun LM:startundo
( doc
) (LM:endundo doc)
)
;; End Undo - Lee Mac
;; Closes an Undo Group.
(defun LM:endundo
( doc
) )
)
;; Active Document - Lee Mac
;; Returns the VLA Active Document Object
(LM:acdoc)
)
;;----------------------------------------------------------------------;;
"\n:: ms2ps.lsp | Version 1.0 | \\U+00A9 Lee Mac "
" www.lee-mac.com ::"
"\n:: Type \"ms2ps\" to Invoke ::"
)
)
;;----------------------------------------------------------------------;;
;; End of File ;;
;;----------------------------------------------------------------------;;