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

eFileAccesErr

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
593 Views, 6 Replies

eFileAccesErr

 This error gives he on the line: "bron.Database.SaveAs("C:\test.dwg", DwgVersion.Current)"

 

Could some help me.

Tanks

 

Maarten

 

 

 

Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTest.Click
        Me.OpenFileDialog1.Filter = "DWG files (*.dwg)|*.dwg"
        Me.OpenFileDialog1.ShowDialog()
        Dim TekeningNaam = Me.OpenFileDialog1.FileName
        BlokNaam = Me.OpenFileDialog1.SafeFileName
        BlokNaam = BlokNaam.Remove(BlokNaam.Length - 4, 4)
        bron = Application.DocumentManager.Add("")
        bron.Database.SaveAs("C:\test.dwg", DwgVersion.Current)
        bron.LockDocument()
        bron.SendStringToExecute("-Insert" & vbCr & TekeningNaam & vbCr & "s 1 r 0 0,0 z all ", True, False, False)

      



    End Sub

6 REPLIES 6
Message 2 of 7
BrentBurgess1980
in reply to: Anonymous

Can you give a bit of a description of what it is you are trying to acheive? I assume that bron is meant to be a Document?

Message 3 of 7
Anonymous
in reply to: BrentBurgess1980

It's open a Wblock in a clean drawning and saved it.

This clean drawning is used for redifined blocks in other drawnings after a revision.

If you want the rest of it, i sent you a personal message.

.Maarten.

Message 4 of 7
Anonymous
in reply to: BrentBurgess1980

Dim bron As Document

Message 5 of 7
BrentBurgess1980
in reply to: Anonymous

I didn't have any problem with the code. I have made some changed to the code (If OpenFileDialog1.ShowDialog() = DialogResult.OK Then).

 

        OpenFileDialog1.Filter = "DWG files (*.dwg)|*.dwg"
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            Dim TekeningNaam = OpenFileDialog1.FileName
            Dim BlokNaam As String = System.IO.Path.GetFileNameWithoutExtension(OpenFileDialog1.FileName)
            Dim bron As Document = ApplicationServices.Application.DocumentManager.Add("")
            bron.Database.SaveAs("C:\test.dwg", DwgVersion.Current)
            bron.LockDocument()
            bron.SendStringToExecute("-Insert" & vbCr & TekeningNaam & vbCr & "s 1 r 0 0,0 z all ", True, False, False)
        End If

 Which line of code was the error occuring?

Can I also recommend that instead of using SendStringToExecute, use one of Tony Tanzillos CommandLine

http://www.caddzone.com/CommandLine.vb

 

Message 6 of 7
Anonymous
in reply to: BrentBurgess1980

Try saving to folder on the C drive

 

Create a folder Test on the C drive and change code to

C:\Test\test.dwg

 

Depending on security settings I have seen mainly Windows 7 reject saving directly to the C drive

Message 7 of 7
Anonymous
in reply to: BrentBurgess1980

Thanks  BrentBurgess1980

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