loopfish Posted December 29, 2015 Share Posted December 29, 2015 A drawing I have have 50 layouts in it. In each layout there is an object that I want to move from paper space to model space. The objects are all on the same layer. Is there a way to do this without doing it for each individual layout tab? Something that says "move any object on this layer that is in paper space to model space" Thanks! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 29, 2015 Share Posted December 29, 2015 You may be able to play with the 410 dxf variable which returns modelspace paperspace etc The problem I see is every object will go to the same co-ords rather than reflect its location in model v's paper. Its not hard to loop through layouts. (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setvar "ctab" (vla-get-name lay) ) ; do your chspace here ) Quote Link to comment Share on other sites More sharing options...
Andrew1979 Posted December 31, 2015 Share Posted December 31, 2015 I wrote a program to export each paperspace layout to a seperate drawing inside a folder automatically. It means each layout is in its own seperate drawing but they will all be in model space at least. It is a LISP file, not sure if you know how to load and run them? ;;;Written by Andrew Espie-Whitburn at ;;;**************************************** ;;;This program exports paperspace layout tabs to seperate drawings in the current drawing location. ;;;To run, Type p2m at the command prompt. (defun C:p2m () (getOldVar) (process) (reset) ) (defun process () (setq filepath (getvar "dwgprefix")) (setq exported "Exported") (setq fulldir (strcat filepath exported)) (vl-mkdir fulldir) (foreach lo (layoutlist) (progn (setvar "CTAB" lo) (setq dwgfn (strcat fulldir "\\" lo)) (command "exportlayout" dwgfn "qsave") );command );progn );end defun (defun getOldVar () (setq oldcmdecho (getvar "cmdecho")) (setq oldfiledia (getvar "filedia")) (command "cmdecho" "0") (setvar "FILEDIA" 0) (command "undo" "mark") (command "undo" "begin") (setq temperr *error*) (setq *error* CCerror) ) (defun CCerror (CCerrmsg) (setq *error* temperror) (setvar "FILEDIA" oldfiledia) (setvar "cmdecho" oldcmdecho) (command "undo" "back") (command "undo" "end") (command "undo" "mark") (prompt "\nCommand Cancelled°... ") ) (defun reset () (command "undo" "back") (command "undo" "end") (command "undo" "mark") (setvar "FILEDIA" oldfiledia) (setvar "cmdecho" oldcmdecho) (prompt "\nExport Complete... ") ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 31, 2015 Share Posted December 31, 2015 Why not reverse engineer it now (setq dwgfn (strcat fulldir "\\" lo)) write to a script file a list of all the dwg names "Insert Dwg1 0,0" "Insert Dwg2 500,0" then insert them back into your current dwg or a new dwg just keep changing the x value of the insertion pt. It is a LISP file, not sure if you know how to load and run them? not sure about this 30+ years of Autocad lisp VBA BASIC Now VL. If everything is in paperspace ie no vewports then just use copyclip and paste to new co-ords in model space. last suggestion is use Layiso to isolate the layers you want before exportlayout. Quote Link to comment Share on other sites More sharing options...
Andrew1979 Posted January 1, 2016 Share Posted January 1, 2016 Why not reverse engineer it now (setq dwgfn (strcat fulldir "\\" lo)) write to a script file a list of all the dwg names "Insert Dwg1 0,0" "Insert Dwg2 500,0" then insert them back into your current dwg or a new dwg just keep changing the x value of the insertion pt. not sure about this 30+ years of Autocad lisp VBA BASIC Now VL. If everything is in paperspace ie no vewports then just use copyclip and paste to new co-ords in model space. last suggestion is use Layiso to isolate the layers you want before exportlayout. Yes i thought you could do something like that too, I just didn't have the interest in writing something to do it. The reason I made the comment about knowing how to run lisp is because some people haven't even heard of it let alone loaded a lisp file, and the question wasn't posted in the LISP section of the forum, just the 2D drafting area so thought the OP might not know Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 2, 2016 Share Posted January 2, 2016 He has made 39 posts so should be aware of lisp. But you are also correct about others reading the post. Quote Link to comment Share on other sites More sharing options...
ParsonTim Posted January 2, 2016 Share Posted January 2, 2016 I'm going to give this a try. Thanks... 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.