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

SaveAs problem in AC2007

3 REPLIES 3
Reply
Message 1 of 4
bowa
355 Views, 3 Replies

SaveAs problem in AC2007

I'm trying to save my AutoCAD drawing using the SaveAs function in AutoCAD 2007 and VS2005.

In AutoCAD 2006 and VB2003 I used:
strFile = Dwg.FullName.ToString()
Dim acadSaveAsType As Object = Dwg.AcSaveAsType.acR18_dwg
Dwg.SaveAs(strFile, acadSaveAsType, Autodesk.AutoCAD.DatabaseServices.SecurityParameters)

This worked without issue but now I'm getting and error indicating that the SecurityParameters are a type and not an object.

Can anyone tell me what object I should be using?
3 REPLIES 3
Message 2 of 4
NathTay
in reply to: bowa

Firstly you are using the ActiveX API not the .NET API.

It should never have worked because as the error indicates you are trying to pass the SecurityParameters type instead of an instance. Given it is an optional value you can leave it out all together.

Dwg.SaveAs(strFile, acR18_dwg)

Regards - Nathan
Message 3 of 4
Anonymous
in reply to: bowa

What you show never worked, at least not as it
was posted.

You're confusing a type, with an instance of a
type. You're passing a type as the security params,
not an instance of the type.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5612704@discussion.autodesk.com...
I'm trying to save my AutoCAD drawing using the SaveAs function in AutoCAD 2007 and VS2005.

In AutoCAD 2006 and VB2003 I used:
strFile = Dwg.FullName.ToString()
Dim acadSaveAsType As Object = Dwg.AcSaveAsType.acR18_dwg
Dwg.SaveAs(strFile, acadSaveAsType, Autodesk.AutoCAD.DatabaseServices.SecurityParameters)

This worked without issue but now I'm getting and error indicating that the SecurityParameters are a type and not an object.

Can anyone tell me what object I should be using?
Message 4 of 4
jbooth
in reply to: bowa

As already stated in previous replies, you are trying to pass a class definition into a function that is expecting an object reference.

You can fix it by creating a new instance of the AcDb.SecurityParameters class and pass that into your saveas function.

However, note that the AcadDocument.SaveAs() function has only one required parameter. The other two are optional.

Calling Dwg.SaveAs(strFile) should work in the general case, as it saves in the current version, and uses the default security parameters.

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