TheSwamp
Code Red => .NET => Topic started by: DBARANAS on September 29, 2006, 05:53:22 AM
-
I wonder if anyone has ever made a new .dwg file by just passing the file name directly without user interaction.
I can't find anything in *.Autodesk.AutoCAD.ApplicationServices and was hoping to find a .net way or maybe a DllImport
I keep project names in a datagridview and want to do all the file chores within my app and lock things up a bit. :evil:
-
Do it all the time.
-
Do it all the time.
I was thinking that this must be common
You can Open and Close a file like this so easy....but no .New
ApplicationServices.Application.DocumentManager.CloseAll()
ApplicationServices.Application.DocumentManager.Open("c:\test.dwg", False)
-
I think you want the Add method of the DocumentCollection object (which DocumentManager is an instance of).
-
I wonder if anyone has ever made a new .dwg file by just passing the file name directly without user interaction.
What about:
Database db = new Database(true,false);
// Adding entities, etc.
//...
db.SaveAs(newDwgFileName,DwgVersion.Current);
Or I've not understand question?
-
Thanks Chuck and Alexander!
Chuck
I tried the DocumentCollection way and it through an error about accessing a private method in that class.
Alexander
I tried this and it worked
Dim db As Database = New Database(True, False)
db.SaveAs("c:\test.dwg", DwgVersion.Current)
BTW...this is the reason I am doing things this way (attached bmp) so that everything made in the app gets created with a derived filename/path so i can span across projects and do reporting, etc. I can also load up projects with just ~3 mouse clicks and also get to anything just as fast.
I also think Windows Explorer was the stupidest thing ever invented, terribly inefficient kinda like Microsoft Bob(if anyone remembers that :lol:)
They should have paid Christian Ghilsler some money. Anyway I'm off on another Rant....Thanks again for helping me both of you
-
'File New' implies that you want a document in the EDITOR and Chuck was right on the money.
If, however, you want to create a new DATABASE, that a different story and Alex was on the money.
A document is associated with a database, but not necessarily so the other way.