insert block in modelspace while in paperspace

insert block in modelspace while in paperspace

Anonymous
Not applicable
376 Views
1 Reply
Message 1 of 2

insert block in modelspace while in paperspace

Anonymous
Not applicable
Hi. Is there any way to insert a block in modelspace while active layout is paperspace and the cursor is inside a viewport? I have this as my code:

space = ThisDrawing.GetVariable("tilemode")
If (space = 1) Then
Set bref = ThisDrawing.ModelSpace.InsertBlock(pt, bnam, 1#, 1#, 1#, 0)
Else:
Set bref = ThisDrawing.PaperSpace.InsertBlock(pt, bnam, 1#, 1#, 1#, 0)
End If

the routine inserts the block in paperspace when the active layout is paperspace even if the cursor is inside a viewport. Thank you.
0 Likes
377 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Use the "CVPORT" variable. If it = 1 then you are in Paperspace, greater
than 1 you are working in Modelspace. Combined with Tilemode you can tell
if you are working in MS thru a PS viewport (but that won't affect your
code).

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi.
Is there any way to insert a block in modelspace while active layout is
paperspace and the cursor is inside a viewport? I have this as my code: space
= ThisDrawing.GetVariable("tilemode") If (space = 1) Then Set bref =
ThisDrawing.ModelSpace.InsertBlock(pt, bnam, 1#, 1#, 1#, 0) Else: Set bref =
ThisDrawing.PaperSpace.InsertBlock(pt, bnam, 1#, 1#, 1#, 0) End If the routine
inserts the block in paperspace when the active layout is paperspace even if
the cursor is inside a viewport. Thank you.
0 Likes