.NET

Reply
Valued Contributor
Prakashdotc
Posts: 88
Registered: ‎03-03-2006
Message 1 of 32 (279 Views)

Creating .dwg file Programmatically

279 Views, 31 Replies
05-02-2006 06:40 AM
Hi All,
How to create a .dwg file with some entity example line, programmatically with c#, can any one help me with example please, thank's

Prakash
Active Contributor
deepa
Posts: 37
Registered: ‎01-10-2007
Message 2 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-15-2007 09:01 PM in reply to: Prakashdotc
using System.io

File.create("C:\\temp\\ex.dwg");
Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 3 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-16-2007 10:15 AM in reply to: Prakashdotc
Can you open that example in acad?
Active Contributor
deepa
Posts: 37
Registered: ‎01-10-2007
Message 4 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-23-2007 08:13 PM in reply to: Prakashdotc
Yes.Sure
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 5 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-23-2007 08:22 PM in reply to: Prakashdotc
No, I tested it.
Creating dwg file is good,but can't open.
That's no available.
create .dvb file,.txt file ..... all is working, but can't open.
Active Contributor
deepa
Posts: 37
Registered: ‎01-10-2007
Message 6 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-24-2007 02:53 AM in reply to: Prakashdotc
Right Click - >Select that File name - >open

It's working in the txt files and other extension files.

but I test it the dwg file.it's true.i will try get a solution for that.
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 7 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-24-2007 07:08 AM in reply to: Prakashdotc
Imports Autodesk.AutoCAD.Runtime
Imports System.io
Public Class GILSclass1
_
Public Sub EraseObjectsFromLayer()
File.Create("C:\\temp\\MyTest.dwg")
End Sub
End Class

Attempting to open created 'MyTest.dwg' file in the specified path, I meet the message of 'Drawing file is not valid.'
*Paul Richardson
Message 8 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-24-2007 08:29 AM in reply to: Prakashdotc
Why would you think that the System.IO knows how to create a dwg file??

wrote in message news:5498917@discussion.autodesk.com...
Imports Autodesk.AutoCAD.Runtime
Imports System.io
Public Class GILSclass1
_
Public Sub EraseObjectsFromLayer()
File.Create("C:\\temp\\MyTest.dwg")
End Sub
End Class

Attempting to open created 'MyTest.dwg' file in the specified path, I meet
the message of 'Drawing file is not valid.'
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 9 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-24-2007 09:39 AM in reply to: Prakashdotc
It's not my thougt, I only follow as you mentioned above.
Using system.io;
*Paul Richardson
Message 10 of 32 (279 Views)

Re: Creating .dwg file Programmatically

02-24-2007 07:54 PM in reply to: Prakashdotc
I didn't mention anyting above...

Database db = new Database();
db.SaveAs(...);
db.Dispose();


wrote in message news:5498985@discussion.autodesk.com...
It's not my thougt, I only follow as you mentioned above.
Using system.io;
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.