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:
How to zoom extend in a new created dwg?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How to zoom extend in a new created dwg? (Read 1834 times)
0 Members and 1 Guest are viewing this topic.
netcai
Mosquito
Posts: 12
How to zoom extend in a new created dwg?
«
on:
April 25, 2018, 10:46:10 AM »
I create a new dwg by c#, I wish to zoom extend this dwg through side database, anybody knows how can I realize it?
Logged
WILL HATCH
Bull Frog
Posts: 450
Re: How to zoom extend in a new created dwg?
«
Reply #1 on:
April 25, 2018, 04:31:09 PM »
It's not worth pursuing IMO. You don't get any preview icon and have to handle a bunch of low level system details.
I make good use of core console for things like this you want hidden from the user.
Code - C#:
[Select]
public
void
StartAutoCAD
(
string
dwgPath
)
{
var
DirInfo
=
new
DirectoryInfo
(
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
ProgramFiles
)
)
;
DirInfo
=
DirInfo
.
GetDirectories
(
"Autodesk"
)
.
FirstOrDefault
(
)
;
var
exefiles
=
DirInfo
.
GetFiles
(
"accoreconsole.exe"
, SearchOption
.
AllDirectories
)
;
string
exepath
=
null
;
if
(
exefiles
.
Length
>
0
)
{
exepath
=
exefiles
[
0
]
.
FullName
;
}
var
scriptpath
=
Path
.
Combine
(
Path
.
GetTempPath
(
)
,
"Temp.scr"
)
;
using
(
var
writer
=
File
.
CreateText
(
scriptpath
)
)
{
writer
.
WriteLine
(
"ZOOM"
)
;
writer
.
WriteLine
(
"EXTENTS"
)
;
writer
.
WriteLine
(
"QSAVE"
)
;
}
var
p
=
new
System.
Diagnostics
.
Process
(
)
;
p
.
StartInfo
.
FileName
=
exepath
;
p
.
StartInfo
.
Arguments
=
string
.
Format
(
"/i
\"
{0}
\"
/s
\"
{1}
\"
"
, dwgPath, scriptpath
)
;
p
.
StartInfo
.
UseShellExecute
=
false
;
p
.
StartInfo
.
CreateNoWindow
=
true
;
p
.
Start
(
)
;
}
Logged
Elisendaz
Guest
Re: How to zoom extend in a new created dwg?
«
Reply #2 on:
May 23, 2018, 12:07:38 AM »
The main forum of this forum is usually where to find it.
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
How to zoom extend in a new created dwg?