Elementary - Moving from Model to Paper space

Elementary - Moving from Model to Paper space

Anonymous
Not applicable
523 Views
7 Replies
Message 1 of 8

Elementary - Moving from Model to Paper space

Anonymous
Not applicable
Hey everyone,

This seems to be very elementary in what I am having problems with. How would you move all of the objects from model space to paper space. I tried a selection set, but that grabs both model and paperspace objects. I was thinking of building an array (variant) and looping thru with for each objEnt in thisdrawing.modelspace and building the array from that.....

Am I on the right track here??? After I get the array what do I do to it to move it to paperspace???

Any help/suggestions would be greatly appreciated!

John Martens
0 Likes
524 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
John,

Here is how you create a selection set of objects in a particular space.

Joe
--

Option Explicit

'DXF Group Code Constants
Public Const SPACE = 67 'Model or Paper space
Public Sonst MODEL = 0
Public Const PAPER = 1

Public Function CreateSelectionSet(SelectionSet As AcadSelectionSet, _
FilterCode As Integer, _
FilterValue As String) As Boolean
Dim iFilterCode(0) As Integer
Dim vFilterValue(0) As Variant

iFilterCode(0) = FilterCode
vFilterValue(0) = FilterValue

SelectionSet.Select acSelectionSetAll, , , iFilterCode, vFilterValue
'SelectionSet.SelectOnScreen intFilterCode, varFilterValue

If SelectionSet.Count Then
CreateSelectionSet = True
End If
End Function

Public Sub SelectBySpace()
Dim objSS As AcadSelectionSet
On Error Resume Next
'delete any previous selection set
ThisDrawing.SelectionSets("Entities").Delete
'create our new selection set
Set objSS = ThisDrawing.SelectionSets.Add("Entities")
'get the actual entities for the selection set
CreateSelectionSet objSS, SPACE, PAPER
'display the results
MsgBox "Number of entities selected: " & objSS.Count
Dim oEntity As AcadEntity
For Each oEntity In objSS
Debug.Print oEntity.ObjectName
Next
End Sub
0 Likes
Message 3 of 8

Anonymous
Not applicable
Joe-

Thanks for the code! I was trying to figure out the dxf codes for that, I had the 67, but could not get the rest. Once I have my selection set, how do I move from paper to model or vice versa??


Thanks!
John Martens
0 Likes
Message 4 of 8

Anonymous
Not applicable
If that is all you're doing, moving objects from
one space to the other, express tools has such a routine, or you could download
CTOS.lsp.  Doing it in vba is a bit more than I want to tackle right
now.

 

HTH,

Mike Weaver

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hey
everyone,

This seems to be very elementary in what I am having problems with. How
would you move all of the objects from model space to paper space. I tried a
selection set, but that grabs both model and paperspace objects. I was
thinking of building an array (variant) and looping thru with for each objEnt
in thisdrawing.modelspace and building the array from that.....

Am I on the right track here??? After I get the array what do I do to it to
move it to paperspace???

Any help/suggestions would be greatly appreciated!

John Martens

0 Likes
Message 5 of 8

Anonymous
Not applicable
Actually Mike and John it's relative simple to do.

C/P the CopyObjects method example from the AutoCAD help files. Then find this line

' Copy object and get back a collection of the new objects (copies)
retObjects = DOC1.CopyObjects(objCollection)

and make this change to it

' Copy object and get back a collection of the new objects (copies)
retObjects = DOC1.CopyObjects(objCollection, ThisDrawing.PaperSpace)

Now you have an example of how to copy an object in model space to paper space.

HTH

Joe
--
0 Likes
Message 6 of 8

Anonymous
Not applicable
That is the easy part.  The tough part is
making sure that the copied objects in paper space appear the same.  This
may involve scaling, and/or 3d rotation, along with ensuring the insertion
point, if you want to call it that, is in the right place.  Consider what
happens if the ucs in the viewport is rotated about all three axis and the zoom
scale is something other than 1:1.  Now add a twist angle to the view in
the viewport.

 

Like I say, the copyobjects is the easy
part.

 

Mike Weaver

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Actually
Mike and John it's relative simple to do.

C/P the CopyObjects method example from the AutoCAD help files. Then find
this line

 
    ' Copy object and get back a collection of the new objects (copies)
    retObjects = DOC1.CopyObjects(objCollection)
and make this change to it
 
    ' Copy object and get back a collection of the new objects (copies)
    retObjects = DOC1.CopyObjects(objCollection, ThisDrawing.PaperSpace)
Now you have an example of how to copy an object in model space to paper
space.

HTH

Joe
--

0 Likes
Message 7 of 8

Anonymous
Not applicable
If you have viewports then why would you want to copy?
0 Likes
Message 8 of 8

Anonymous
Not applicable
Hi Joe,

In Land Desktop the Sheet Manager process automatically creates a
combination of Viewport Information and paper space information. Users
without Land Desktop cannot use the tools to recall a series of drawings
with these characteristics and it can be desirable to assemble stand alone
drawings of the data by copying the model space data from the viewport to
paper space.

--


Laurie Comerford
CADApps
www.cadapps.com.au


"joesu" wrote in message
news:f169316.5@WebX.maYIadrTaRb...
> If you have viewports then why would you want to copy?
0 Likes