Jump to content

Cannot open AutoCAD drawing from .NET


Recommended Posts

Posted

Visual Studio 2008 / VB.NET

AutoCAD 2006

 

Hi:

 

This worked last week. Somehow it is no longer working now. I must be missing something. I need to open a drawing from VB.NET. Wheh I run this code, I get the following error:

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in MakeSpoolFix.exe

 

Code:

Dim fullname As String = "L:\3105\310556A1.dwg"

Try

acadApp = GetObject(, "AutoCAD.Application.16.2")

Catch

acadApp = CreateObject("AutoCAD.Application.16.2")

End Try

acadApp.Visible = True

Debug.WriteLine(fullName)

Me.lblStatus.Text = "Running MakeSpool Fix on " & fullName & "..."

acadApp.Documents.Open(fullName, False)

acadDoc = acadApp.ActiveDocument

acadDoc.SendCommand("(wblockpurge) ")

 

Thanks in advance fr the help!

 

Posted

I dont know the answer to your problem but I can see another developing "AutoCAD.Application.16.2"

What happens when you upgrade your autocad and its now 16.3. Ok for testing but I would do a call to a routine that checks version numbers etc I have one sub that has version numbers in it and autoload it so available anytime. upgrade software upgrade 1 program only.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...