Hi All,
Does anyone have a solution for moving objects from model space to paper space other than creating blocks? I'm thinking something like using entmod and changing DXF code 410, but this doesn't seem to work (Is code 410 read only?).
Any suggestions will be most welcome.
Cheers
John
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
@iwafb wrote:
That's the way we are doing it at the moment. I was looking for a LISP solution...
Thanks
John
Curious, why not use
command: chspace
If you really want a lisp solution , i think i wrote something similar to that a long time ago. I'll have a look-see if i can find it at all....
The reason I want lisp is because this is a small part of a much larger process and could all be done at the literal "click of a button". I have not used CHSPACE before, but i did see it referenced on other posts. However, when I investigated it, the command was not allowed in model space so I didn't think if a viable option. In case I'm missing something, how would you propose to use chspace in this instance?
Cheers,
John
@iwafb wrote:
The reason I want lisp is because this is a small part of a much larger process and could all be done at the literal "click of a button". I have not used CHSPACE before, but i did see it referenced on other posts. However, when I investigated it, the command was not allowed in model space so I didn't think if a viable option. In case I'm missing something, how would you propose to use chspace in this instance?
Cheers,
John
So you are wanting to transfer the Model space entity to Pspace but the problem is you are at Model Space and there are no viewports correct?
What about the positions of the entities? where exactly would it land on the layout tab? and is there more than one layout tab?
The positioning of the entities will be exactly the same in paper space as it is in model space. At the moment, the process is to copy all entites using 0,0,0 and pasting in paper space at 0,0,0. We do have more than one layout tab, and eventually we may want to copy these entities over several layout tabs. But, for the moment, just happy to move the elements to the first layout tab available (generally "Layout1")...
Thanks,
John
@iwafb wrote:
The positioning of the entities will be exactly the same in paper space as it is in model space. At the moment, the process is to copy all entites using 0,0,0 and pasting in paper space at 0,0,0. We do have more than one layout tab, and eventually we may want to copy these entities over several layout tabs. But, for the moment, just happy to move the elements to the first layout tab available (generally "Layout1")...
Thanks,
John
(defun c:m2s (/ i aDoc LayoutColl MoveToLayout ss ObjToMove) ;;; pBeFeb2014 ;;; (vl-load-com) (setq i -1 adoc (vla-get-activedocument (vlax-get-acad-object)) LayoutColl (vla-get-layouts adoc) ) (if (and (setq MoveToLayout nil ss (ssget "_:L") ) (not (textscr)) (foreach itm (layoutlist) (princ (strcat "\nInput " (itoa (setq i (1+ i))) " for layout " itm ) ) ) (setq lnum (getint "\nEnter Index value: ")) (setq NLNAme (nth lnum (layoutlist))) ) (progn (vlax-for x (setq ObjToMove (vla-get-activeselectionset aDoc)) (setq MoveToLayout (cons x MoveToLayout)) ) (vla-delete ObjToMove) (vla-CopyObjects ADoc (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbObject (cons 0 (1- (length MoveToLayout))) ) MoveToLayout ) ) (vla-get-block (vla-item LayoutColl NLNAme)) ) (foreach O MoveToLayout (vla-delete O)) ) ) (princ) )(vl-load-com)
I know this is a little late in the game, but... You have to be in paper space to use the CHSPACE command. In paper space, double click in the vport. You will be working in model space but you are still in the paper space tab. Now, use CHSPACE. The objects selected will be transferred to paper space.
I know this is a older thread but if anyone reads it. I have tried this code and i get an error message
; error: Automation Error. Invalid owner object
I do not know what this means.
You could just use the native AutoCAD command CHSPACE, very easy and no code to mess with. In paperspace go into the viewport, select your objects you want transferred to paperspace and use the CHSPACE command.
No viewport for change space.
The files were converted from Microstation and there are a lot of them.
@chris.slattery wrote:
No viewport for change space. ....
Then where are you trying to move things to, or from? The Title of this thread doesn't seem to have any relevance in the absence of viewports.
I want to move everything in model to layout. This code works but you have to select objects first then the text window opens and you have to enter 0 for the first layout space. I did not want to do all of that. I modified the code by taking out the (not (textscr)) so the text window does not open and I changed the line (setq lnum (getint "\nenter index value: ")) to be hard coded at 0. (setq lnum 0). I did this at home and it worked just fine. Now on my work computer I get that error message.
@chris.slatteryIf no viewport exists, create one, go inside the viewport and do a SELECT/ALL command and then do the CHSPACE command.
@chris.slatteryOr just do a SELECT/ALL copy and paste from model space to paper space and then scale in paper space accordingly.