.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get Default SecurityParameters when Using SaveAs (C#) AutoCAD 2008

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
966 Views, 2 Replies

How to get Default SecurityParameters when Using SaveAs (C#) AutoCAD 2008

In my code I am testing to see if the drawing path exists and if not, using SaveAs to save the file. The SaveAs command takes a parameter of type SecurityParameters. It will not allow me to create the object with new SecurityParameters(). Instead it wants a long list of parameters. All I wish to do is create the file as a normal file with no special permissions.



SecurityParameters sp = new SecurityParameters("password", "providerName", "subject", "issuer", "serialNumber", "comment", "TimeServer", Actions, Algorithm, keyLength, providerType);

oAcadApp.ActiveDocument.SaveAs(sFilePath, DwgVersion.Newest,sp);

SecurityParameters sp = new SecurityParameters();// does not compile

note oAcadApp.ActiveDocument.SaveAs(sFilePath, DwgVersion.Newest,null); does not compile.
2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: Anonymous

Since the SecurityParam is optional parameter in the SaveAs() method of AcadDocument object and you tried to use "null", I assume you just want to do SaveAs without security stuff (password protecting or digital signature embedding...).

In VB/VBA/VB.NET, you can simply ignore the parameter and do SaveAs(filePath, Version). NOw that you use C#, you do not pass in null for the optinal argument that you do not need to use. Try to use System.Reflection.Missing.Value instead:

AcadDocument.SaveAs(filePath, fileVersion,System.Reflection.Missing.Value)

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks for that bit of Info, I had forgotten about that.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost