.NET

Reply
Valued Contributor
Prakashdotc
Posts: 88
Registered: ‎03-03-2006
Message 1 of 7 (1,047 Views)

AcadDocument.SaveAs

1047 Views, 6 Replies
05-02-2006 05:31 AM
Hi All,
I have to create a .dwf file and save it programmatically using C#, here's my code regarding this, but it's not working

app = new AcadApplicationClass();
AcadDocument doc = app.ActiveDocument;
doc.SaveAs(@"c:\Sam.dwg",AcSaveAsType.acR15_dwg,new Autodesk.AutoCAD.DatabaseServices.SecurityParameters());

can anyone solve my problem, thank's

Prakash.C
Distinguished Contributor
RonnieWilkins
Posts: 453
Registered: ‎04-07-2003
Message 2 of 7 (1,047 Views)

Re: AcadDocument.SaveAs

05-02-2006 02:10 PM in reply to: Prakashdotc
You do not save as a dwf. You print to the DWF plotter.
Ronnie Wilkins, Jr.
AMS CAD + CAFM Solutions
Sr. Solutions Developer
Autodesk Certified Instructor: Inventor
Valued Contributor
Prakashdotc
Posts: 88
Registered: ‎03-03-2006
Message 3 of 7 (1,047 Views)

Re: AcadDocument.SaveAs

05-02-2006 10:57 PM in reply to: Prakashdotc
Sorry rwilkins,

by mistake i mentioned as .dwf actually i have to create a .dwg with some basic entities programmatically, that's it, do U have any solution for it....?

Prakash.C
Distinguished Contributor
RonnieWilkins
Posts: 453
Registered: ‎04-07-2003
Message 4 of 7 (1,047 Views)

Re: AcadDocument.SaveAs

05-03-2006 01:52 PM in reply to: Prakashdotc
might try not supplying the new security object instead only supply filepath and version info.
Ronnie Wilkins, Jr.
AMS CAD + CAFM Solutions
Sr. Solutions Developer
Autodesk Certified Instructor: Inventor
Valued Contributor
Prakashdotc
Posts: 88
Registered: ‎03-03-2006
Message 5 of 7 (1,047 Views)

Re: AcadDocument.SaveAs

05-03-2006 11:57 PM in reply to: Prakashdotc
Hi rwilkins,

Now it's working i changed it as

doc.SaveAs("d:\\Sam.dwg",AcSaveAsType.acR15_dwg,new Autodesk.AutoCAD.DatabaseServices.SecurityParameters());

Prakash.C
Active Contributor
lbayas
Posts: 26
Registered: ‎12-06-2006
Message 6 of 7 (1,047 Views)

Re: AcadDocument.SaveAs

11-20-2007 08:07 AM in reply to: Prakashdotc
This was really helpful Prakash. I do get an error with the last parameter:

new Autodesk.AutoCAD.DatabaseServices.SecurityParameters()

It states that this is obsolete. I think this may be because I am using AutoCAD 2008. Are there any suggestions?
New Member
ronixjdiaz
Posts: 1
Registered: ‎03-21-2013
Message 7 of 7 (338 Views)

Re: AcadDocument.SaveAs

03-21-2013 12:34 PM in reply to: lbayas

If you want, you can use only  two  parameters.

doc.SaveAs("d:\\Sam.dwg",AcSaveAsType.acR15_dwg)

In my case I have used it for save my file like a *.dxf

doc.SaveAs("d:\\Sam.dwg",AcSaveAsType.acR15_dxf)

It continues works in Autocad 2013

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community