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

Problem with VB2012 and AutoCAD2015

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
dirkborowski29
560 Views, 5 Replies

Problem with VB2012 and AutoCAD2015

Hi!
Sorry for my English.
I have a program in VB2010 (AutoCAD2012) to VB2012 (AutoCAD2015)
taken. Unfortunately, when I start it now (netload), nothing happens.
Admit it still features the in VB2012 (AutoCAD2015) must be observed?

Thank you for your help.

 

Imports System
Imports System.IO
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Windows

Imports Autodesk.AutoCAD.Runtime.RuntimeSystem
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.Colors
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.GraphicsSystem.View
Imports Autodesk.AutoCAD.Windows
Imports Autodesk.AutoCAD.Runtime

<Assembly: CommandClass(GetType(LB_System_Standrohr.MyCommands))> 

Namespace LB_System_Standrohr

    Public Class MyCommands

        <CommandMethod("LB_Standrohr")>
        Public Sub FormLoad1()


            Dim myDoc As Document = DocumentManager.MdiActiveDocument
            Dim myDB As Database = myDoc.Database

            Using myTrans As Transaction = myDB.TransactionManager.StartTransaction
                Try

                    '--Linientyp laden "VERDECKT" und "STRICHPUNKT"
                    Dim myLineTypTable As LinetypeTable
                    myLineTypTable = myTrans.GetObject(myDB.LinetypeTableId, OpenMode.ForRead)

                    Dim myVERDECKT As String = "VERDECKT"
                    If myLineTypTable.Has(myVERDECKT) = False Then
                        myDB.LoadLineTypeFile(myVERDECKT, "acad.lin")
                    End If

                    Dim mySTRICHPUNKT As String = "STRICHPUNKT"
                    If myLineTypTable.Has(mySTRICHPUNKT) = False Then
                        myDB.LoadLineTypeFile(mySTRICHPUNKT, "acad.lin")
                    End If

            '--Form laden bzw. aufrufen
            Dim FormObj1 As LB_System = New LB_System
            FormObj1.StartPosition = Forms.FormStartPosition.CenterScreen
            FormObj1.ShowDialog()
        End Sub

    End Class

End Namespace

 

5 REPLIES 5
Message 2 of 6
mcicognani
in reply to: dirkborowski29

It seems to be a porting problem, check all of the base things:

 

- AutoCAD 2015 is not binary compatible with previous versions, you have to recompile using NET framework 4.5.0 or 4.5.1 (see application properties)

- you must reference dll from ObjectARX 2015 (AcMgd, AcDbMgd, ecc.). Check reference folders also in project properties.

 

 

 

Message 3 of 6
dirkborowski29
in reply to: mcicognani

Hi!

The program was originally created with VB2010 under AutoCAD 2012.
Now I have opened the program in VB2012 and changed the following:
References from the
- AcCoreMgd, AcDbMgd, AcMgd from the directory C: \ ObjectARX 2015
- Local copy set to False
-. Net Framework 4.5

VB2012 does not show any errors.
At startup / debug but not AutoCAD 2015 special launched in 2012 AutoCAD.

Why might that be?
Is there a solution for this problem?

Thanks in advance.

Message 4 of 6
hgasty1001
in reply to: dirkborowski29

Hi,

 

I see some problems:

 

1.- A missing space + underscore after the command attribute

2.-The call to the form LB_System shoud be :Application.ShowModalDialog(FormObj1)

3.- Not sure if the positioning of the form will work, I usually set the form positioning in the form itself.

 

Gaston Nunez

 

Message 5 of 6
mcicognani
in reply to: dirkborowski29

Not sure what's your last problem... you mean that when you start debugging you don't see AutoCAD 2015 starting automatically? You should check the project properties, debug panel. There you find the program that Visual Studio will start when debugging. If the project worked already with AutoCAD 2012, you should see the previous path, that you may change to 2015. Also, when AutoCAD starts, don't expect that the DLL will be loaded automatically. You must manually execute NETLOAD and pick the dll in the project/bin/debug folder. Alternatively, you may write a little script and add it to the startup parameters of AutoCAD, so that the debug dll will be loaded at every debug launch.
Message 6 of 6
dirkborowski29
in reply to: mcicognani

Hello!

I have my problem to solve now.

It was up to the ... vbproj.user file.
Here I have adapted these directories and now it works.
- <ReferencePath> C: \ ObjectARX 2015 \ inc </ ReferencePath>
- <StartProgram> C: \ Program Files \ Autodesk \ AutoCAD 2015 \ acad.exe </ Start Program>

Thanks again for the suggestions.

greeting

Dirk

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