INSUNITS and Paper space
Is there a variable that overrides INSUNITS in layouts (paperspace). In Autocad it is always mm or in in paper space no matter the units in model space. Problem is when i copy my paperspace objects (like drawing description) which are always the same size from let's say situation layout which is in meters (model space) to details layout which are in cm it gets scaled. There should be some line of code that sets Source and Target units to mm (or inches) if you do a copy from one layout to other (different files).
0
Comments
-
Hi Marin,
Since V13.1.15 BricsCAD has respected the setting of INSUNITS when using COPYCLIP, or COPYBASE. This can't be overridden. As far as I'm aware AutoCAD ignores INSUNITS with these commands. I agree with you that technically there is only two valid units for a layout: mm, or inches. These are the only choices available when applying print settings to a layout.
The following LISP code will temporarily override INSUNITS when copying from paperspace. Hopefully this provides you a viable work around.
[code];------------------------------------------------------------------------------
; COPY CLIPBOARD INSUNITS
;
; CopyClipboardInsunits.lsp
;
; PURPOSE:
; BricsCAD respects the value of INSUNITS when copying between drawings
; (AutoCAD ignores) using COPYCLIP, and COPYBASE). This can give unexpected
; results for users that use different units between Modelspace and Paperspace.
;
; When copying from paperspace these routines set INSUNITS = 0 (No units) prior
; to copying to the Clipboard to avoids scaling being applied when copying and
; pasting. ; INSUNITS are not changed if copying from Modelspace
;
; COMMANDS
;
; COPYCLIP-NOUNITS
; COPYBASE-NOUNITS
;
; NOTES:
; These functions may be affected by INSUNITSDEFTARGET, depending on what
; value it has been set to. INSUNITSDEFTARGET sets the target drawing units
; when INSUNITS is set to 0.
;
; May give unexpected results if copying and pasting to different spaces.
;
;------------------------------------------------------------------------------
(defun C:CopyClip-NoUnits ( / *ERROR* sset)
;Error handler
(defun *ERROR* (error_msg)
(if error_msg (princ (strcat "\n" error_msg ))) ; Print error message if given
(acet-sysvar-restore) ; reset any environment variables to their previous state
(prin1)
)
(princ "\nSelect entities to copy to the clipboard: ") ; prompt user
(setq sset (ssget)) ; Create a selection set, only accepting Multi Leader objects
(if sset ; if a valid selection set is created
(progn ; THEN
(if (> 2 (getvar 'CVPORT)) ; save environment variables based on which space we're in
(acet-sysvar-set '("CMDECHO" 0 "INSUNITS" 0)) ; Paperspace
(acet-sysvar-set '("CMDECHO" 0 )) ; Modelspace
)
(command "._COPYCLIP" sset "") ; copy our objects to the clipboard, in the process they will be converted.
(princ (strcat "\n" (itoa (sslength sset)) " entities copied to clipboard")) ; prompt user as to what has happended.
(acet-sysvar-restore) ; reset any environment variables to their previous state
) ; end progn
(princ "\nNo entities selected") ; ELSE prompt user
) ; end if
(prin1) ; make a quiet exit
) ; end CopyClip-NoUnits
(defun C:CopyBase-NoUnits ( / *ERROR* bp sset)
;Error handler
(defun *ERROR* (error_msg)
(if error_msg (princ (strcat "\n" error_msg ))) ; Print error message if given
(acet-sysvar-restore) ; reset any environment variables to their previous state
(prin1)
)
(initget 1) ; don't allow null entry
(setq bp (getpoint "\nSelect base point: "))
(if bp
(progn
(princ "\nSelect entities to copy to the clipboard: ") ; prompt user
(setq sset (ssget)) ; Create a selection set, only accepting Multi Leader objects
(if sset ; if a valid selection set is created
(progn ; THEN
(if (> 2 (getvar 'CVPORT)) ; save environment variables based on which space we're in
(acet-sysvar-set '("CMDECHO" 0 "INSUNITS" 0)) ; Paperspace
(acet-sysvar-set '("CMDECHO" 0 )) ; Modelspace
)
(command "._COPYBASE" bp sset "") ; copy our objects to the clipboard, in the process they will be converted.
(princ (strcat "\n" (itoa (sslength sset)) " entities copied to clipboard")) ; prompt user as to what has happended.
(acet-sysvar-restore) ; reset any environment variables to their previous state
) ; end progn
(princ "\nNo entities selected") ; ELSE prompt user
) ; end if
) ; end progn
(princ "\nNo point selected") ; ELSE prompt user
); end if
(prin1) ; make a quiet exit
) ; end CopyBase-NoUnits
(princ "\nClipboard Copy with No Units Loaded type COPYCLIP-NOUNITS, or COPYBASE-NOUNITS to run") ; Inform user of commands
(prin1) ; make a quiet exit[/code]
Regards,Jason Bourhill
0 -
Works perfectly! Thank You!0
This discussion has been closed.