Draw in Paperspace or Modelspace
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Draw in Paperspace or Modelspace

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Rob Peterson
Guest





Posted: Fri Mar 18, 2005 10:14 pm    Post subject: Draw in Paperspace or Modelspace Reply with quote

How do you get VBA to draw in either model or paper space, depending on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that does
not work.

Any help is appreciated.

Back to top
Jeff Mishler
Guest





Posted: Fri Mar 18, 2005 10:40 pm    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

This is how I do it:
Code:

Dim oSpace As AcadBlock
If ThisDrawing.GetVariable("cvport") = 1 Then
    Set oSpace = ThisDrawing.PaperSpace
Else
    Set oSpace = ThisDrawing.ModelSpace
End If

Set objBubble = oSpace.AddCircle(BubblePnt, BubbleRad)


--
Jeff
check out www.cadvault.com
"Rob Peterson" <autodesk.autocad.customization.vba> wrote in message
news:423b0c83$1_1@newsprd01...
Quote:
How do you get VBA to draw in either model or paper space, depending on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that
does
not work.

Any help is appreciated.

Back to top
Joe Sutphin
Guest





Posted: Fri Mar 18, 2005 10:54 pm    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

I believe this is what he's looking for:

ThisDrawing.ActiveSpace = acPaperSpace or ThisDrawing.ActiveSpace =
acModelSpace


Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1290$1_2@newsprd01...
Quote:
This is how I do it:
Code:

Dim oSpace As AcadBlock
If ThisDrawing.GetVariable("cvport") = 1 Then
Set oSpace = ThisDrawing.PaperSpace
Else
Set oSpace = ThisDrawing.ModelSpace
End If

Set objBubble = oSpace.AddCircle(BubblePnt, BubbleRad)


--
Jeff
check out www.cadvault.com
"Rob Peterson" <autodesk.autocad.customization.vba> wrote in message
news:423b0c83$1_1@newsprd01...
How do you get VBA to draw in either model or paper space, depending on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that
does
not work.

Any help is appreciated.





Back to top
Jeff Mishler
Guest





Posted: Fri Mar 18, 2005 11:15 pm    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

I read it that he wants to draw in the space that is currently active. If
you are working in MS through a PS Viewport, the ActiveSpace will report
that you are in PS. The code I showed ensures you draw in the Space that the
user is really working in ..........

--
Jeff
check out www.cadvault.com
"Joe Sutphin" <joesutphin@earthlink.com> wrote in message
news:423b15d3$1_2@newsprd01...
Quote:
I believe this is what he's looking for:

ThisDrawing.ActiveSpace = acPaperSpace or ThisDrawing.ActiveSpace =
acModelSpace


Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1290$1_2@newsprd01...
This is how I do it:
Code:

Dim oSpace As AcadBlock
If ThisDrawing.GetVariable("cvport") = 1 Then
Set oSpace = ThisDrawing.PaperSpace
Else
Set oSpace = ThisDrawing.ModelSpace
End If

Set objBubble = oSpace.AddCircle(BubblePnt, BubbleRad)


--
Jeff
check out www.cadvault.com
"Rob Peterson" <autodesk.autocad.customization.vba> wrote in message
news:423b0c83$1_1@newsprd01...
How do you get VBA to draw in either model or paper space, depending on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that
does
not work.

Any help is appreciated.





Back to top
Joe Sutphin
Guest





Posted: Fri Mar 18, 2005 11:19 pm    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

I realize exactly what your code is doing. However, I think he wanted to
know how to make the active space one or the other. I generally change to
the appropriate space, do my work, and change back.

Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1abb$1_1@newsprd01...
Quote:
I read it that he wants to draw in the space that is currently active. If
you are working in MS through a PS Viewport, the ActiveSpace will report
that you are in PS. The code I showed ensures you draw in the Space that
the user is really working in ..........

--
Jeff
check out www.cadvault.com
"Joe Sutphin" <joesutphin@earthlink.com> wrote in message
news:423b15d3$1_2@newsprd01...
I believe this is what he's looking for:

ThisDrawing.ActiveSpace = acPaperSpace or ThisDrawing.ActiveSpace =
acModelSpace


Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1290$1_2@newsprd01...
This is how I do it:
Code:

Dim oSpace As AcadBlock
If ThisDrawing.GetVariable("cvport") = 1 Then
Set oSpace = ThisDrawing.PaperSpace
Else
Set oSpace = ThisDrawing.ModelSpace
End If

Set objBubble = oSpace.AddCircle(BubblePnt, BubbleRad)


--
Jeff
check out www.cadvault.com
"Rob Peterson" <autodesk.autocad.customization.vba> wrote in message
news:423b0c83$1_1@newsprd01...
How do you get VBA to draw in either model or paper space, depending on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that
does
not work.

Any help is appreciated.







Back to top
Jeff Mishler
Guest





Posted: Fri Mar 18, 2005 11:50 pm    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

OK, now you've piqued my interest. ;-) How does changing your ActiveSpace
affect your work? AFAIK, switching space just to add a line or arc or
whatever just adds a regen or two, since you still must use the ModelSpace
or Paperpace object to add it to....or have I been missing something?

Thanks,
--
Jeff

"Joe Sutphin" <joesutphin@earthlink.com> wrote in message
news:423b1bcb$1_3@newsprd01...
Quote:
I realize exactly what your code is doing. However, I think he wanted to
know how to make the active space one or the other. I generally change to
the appropriate space, do my work, and change back.

Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1abb$1_1@newsprd01...
I read it that he wants to draw in the space that is currently active. If
you are working in MS through a PS Viewport, the ActiveSpace will report
that you are in PS. The code I showed ensures you draw in the Space that
the user is really working in ..........

--
Jeff
check out www.cadvault.com
"Joe Sutphin" <joesutphin@earthlink.com> wrote in message
news:423b15d3$1_2@newsprd01...
I believe this is what he's looking for:

ThisDrawing.ActiveSpace = acPaperSpace or ThisDrawing.ActiveSpace =
acModelSpace


Joe
--

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:423b1290$1_2@newsprd01...
This is how I do it:
Code:

Dim oSpace As AcadBlock
If ThisDrawing.GetVariable("cvport") = 1 Then
Set oSpace = ThisDrawing.PaperSpace
Else
Set oSpace = ThisDrawing.ModelSpace
End If

Set objBubble = oSpace.AddCircle(BubblePnt, BubbleRad)


--
Jeff
check out www.cadvault.com
"Rob Peterson" <autodesk.autocad.customization.vba> wrote in message
news:423b0c83$1_1@newsprd01...
How do you get VBA to draw in either model or paper space, depending
on
which one is active.

The following will draw in paperspace:

Set objBubble = ThisDrawing.PaperSpace.AddCircle(BubblePnt, BubbleRad)

This will draw in modelspace:

Set objBubble = ThisDrawing.ModelSpace.AddCircle(BubblePnt, BubbleRad)

What do I need to change? I've tried ThisDrawing.ActiveSpace but that
does
not work.

Any help is appreciated.









Back to top
Mike Tuersley
Guest





Posted: Sat Mar 19, 2005 9:25 am    Post subject: Re: Draw in Paperspace or Modelspace Reply with quote

ThisDrawing.ActiveLayout.Block.Addwhatever

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB