Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
Switch from Viewport to Paper
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Switch from Viewport to Paper (Read 1460 times)
0 Members and 1 Guest are viewing this topic.
Andrey Bushman
Swamp Rat
Posts: 864
Switch from Viewport to Paper
«
on:
September 12, 2012, 06:14:15 AM »
Hi all.
How can I to switch from Viewport to Paper?
Code - C#:
[Select]
Boolean modalSpaceIsCurrent
=
(
(
Int16
)
acad
.
GetSystemVariable
(
"TILEMODE"
)
)
==
1
?
true
:
false
;
if
(
modalSpaceIsCurrent
)
{
ed
.
WriteMessage
(
"Command is canceled - MODEL space is current.
\n
"
)
;
return
;
}
Boolean viewportIsCurrent
=
!
modalSpaceIsCurrent
&&
(
(
Int16
)
acad
.
GetSystemVariable
(
"CVPORT"
)
)
!=
1
?
true
:
false
;
if
(
viewportIsCurrent
)
{
ed
.
WriteMessage
(
"Go out from Viewport to Paper...
\n
"
)
;
//But it not switched from Viewport to paper:
ed
.
SwitchToPaperSpace
(
)
;
}
How can I do it?
Regards
Logged
Andrey Bushman
Swamp Rat
Posts: 864
Re: Switch from Viewport to Paper
«
Reply #1 on:
September 12, 2012, 06:24:18 AM »
I apologize... I forgot to write transaction.Commit();
Problem is solved.
Moderator, delete it topic, please.
Logged
Kerry
Mesozoic relic
Seagull
Posts: 11654
class keyThumper<T>:ILazy<T>
Re: Switch from Viewport to Paper
«
Reply #2 on:
September 12, 2012, 06:30:37 AM »
Andrey, I'll leave it there if you don't mind.
The post may help someone later.
Can you post the rectified code, just for completeness please ?
Regards
Kerry
Logged
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.
Andrey Bushman
Swamp Rat
Posts: 864
Re: Switch from Viewport to Paper
«
Reply #3 on:
September 12, 2012, 07:53:09 AM »
Code - C#:
[Select]
Boolean modalSpaceIsCurrent
=
(
(
Int16
)
acad
.
GetSystemVariable
(
"TILEMODE"
)
)
==
1
?
true
:
false
;
if
(
modalSpaceIsCurrent
)
{
ed
.
WriteMessage
(
"Command is canceled - MODEL space is current.
\n
"
)
;
return
;
}
Boolean viewportIsCurrent
=
!
modalSpaceIsCurrent
&&
(
(
Int16
)
acad
.
GetSystemVariable
(
"CVPORT"
)
)
!=
1
?
true
:
false
;
if
(
viewportIsCurrent
)
{
ed
.
WriteMessage
(
"Go out from Viewport to Paper...
\n
"
)
;
ed
.
SwitchToPaperSpace
(
)
;
}
...
//tr - Transaction
tr
.
Commit
(
)
;
// <- it row need.
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
Switch from Viewport to Paper