• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Map 3D Developer

    Reply
    Contributor
    khushboo.singh
    Posts: 20
    Registered: ‎11-09-2011

    Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    477 Views, 29 Replies
    06-11-2012 04:34 AM

    Hi,

    We have a VB application which was written with AutoCAD Map 2008 version.

    We now need to re-write the entire application with AutoCAD Map 3D in VB.NET

    Can anybody suggest some good specs/pointer?

    And the way to do it...

     

    Thanks

    Please use plain text.
    *Expert Elite*
    Posts: 681
    Registered: ‎04-27-2009

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    06-11-2012 09:10 AM in reply to: khushboo.singh

    It is very difficult to give much useful opinions/suggestions without knowing more details on what you have and you you want to do.

     

    What kind of VB application do you have? is it an external EXE app, or it is VBA code running inside Acad, or it is VB ActiveX DLL project that is loaded into AutoCAD via VBA? What the application does?

     

    When you want to rewrite it with VB.NET, are you going to do it as external EXE app? or if you want to make it DLL project, then do you want to use COM API, or .NET API (AutoCAD .NET API and/or Map .NET API)?

    Please use plain text.
    Contributor
    khushboo.singh
    Posts: 20
    Registered: ‎11-09-2011

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    06-14-2012 04:06 AM in reply to: khushboo.singh

    We have Vb 6 ActiveX dll applicatio which we want to convert to VB.NET 2008 DLL.

    The application works with drawing files where we can add spaces to the floor of a building.

    We can delete spaces as well.

     

    When we want to convert to VB.NET 2008 DLL, we want to use .NET API (AutoCAD map 3D .NET API)

    Please use plain text.
    *Expert Elite*
    Posts: 681
    Registered: ‎04-27-2009

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    06-14-2012 06:57 AM in reply to: khushboo.singh

    If you have .NET development experience, I am sure you know VB6 and VB.NET are very different other than their similar syntex. In most cases, there is no way to convert a VB6 project to a sound, workable VB.NET project. 

     

    Also, if you intend to use AutoCAD .NET API, then again, it is very different from AutoCAD COM API.

     

    These two factors guarantees that whatever you have done in the VB6 project has to be rewritten with new API (AutoCAD .NET API) and new programming paradigm (.NET).

     

    You can get started with AutoCAD .NET Programming labs, provided by Autodesk, or works on .NET code samples fond in ObjectARX SDK, or check this out:

     

    http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html

     

    You may also want to visit and post your question in Autodesk Discussion Group -> AutoCAD -> AutoCAD Customization -> .NET forum, in regarding of generic AutoCAD .NET issue (other than specific AutoCAD Map programming issue).

     

     

    Please use plain text.
    Contributor
    khushboo.singh
    Posts: 20
    Registered: ‎11-09-2011

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-02-2012 06:23 AM in reply to: khushboo.singh

    I have created SDF using a dwg file in AutoCAD Map 3D 2012.

    But I am not able to open the SDF file as I don't have a tool to open it.

    Could you please suggest a tool to open it so that I can view the features & the layers that are embedded into it?

    Could you please tell me the link from where I can download such tool?

    Please use plain text.
    *Expert Elite*
    Posts: 6,432
    Registered: ‎06-29-2007

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-03-2012 12:30 AM in reply to: khushboo.singh

    Hi,

     

    >> But I am not able to open the SDF file as I don't have a tool to open it.

    Joke? :smileywink:

     

    You have Map3D, why don't you open the SDF with your Map3D then?

    You can import it with _MAPIMPORT, you can reference it with _MAPCONNECT.

     

    - alfred -

    -------------------------------------------------------------------------
    Alfred NESWADBA
    Ingenieur Studio HOLLAUS ... www.hollaus.at
    -------------------------------------------------------------------------
    Please use plain text.
    Contributor
    khushboo.singh
    Posts: 20
    Registered: ‎11-09-2011

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-07-2012 09:21 PM in reply to: alfred.neswadba

    I am developing a project in VB.NET with AutoCAD Map 3D 2012.

    I am opening a dwg file & want to know the layers that are present in the dwg file & then want to process those layers as per the requirement.

    I tried to use AcMapMap.GetCurrentMap()

    but it is failing, there is no such AcMapMap in AutoCAD Map 3D 2012.

    Could you please tell me the way how should I know the name of the dwg file that I m opening & the layers that are present in the file?

    Please use plain text.
    *Expert Elite*
    Posts: 6,432
    Registered: ‎06-29-2007

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-08-2012 02:49 AM in reply to: khushboo.singh

    Hi,

     

    what references have you set within your project? I have referenced these dll's

    • Autodesk.Map.Platform.dll
    • Autodesk.Map.Platform.Core.dll
    • OSGeo.MapGuide.Foundation.dll
    • OSGeo.MapGuide.PlatformBase.dll

    ...to get this running:

    Imports Autodesk.AutoCAD
    Imports Autodesk.Gis.Map
    Imports OSGeo.MapGuide
    
    Public Class cFdoTools
    
       <Autodesk.AutoCAD.Runtime.CommandMethod("myTools_getFdoLayers")> _
       Public Shared Sub getFdoLayers()
          Dim tLoadedFdoLayer As String = ""
          Try
             Dim tCurrentMap As Platform.AcMapMap = Platform.AcMapMap.GetCurrentMap()
             If (tCurrentMap IsNot Nothing) AndAlso (tCurrentMap.GetLayers IsNot Nothing) Then
                Dim tLayerColl As MgLayerCollection = tCurrentMap.GetLayers
                If (tLayerColl IsNot Nothing) AndAlso (tLayerColl.Count > 0) Then
                   For Each tLayer As MgLayerBase In tLayerColl
                      tLoadedFdoLayer &= tLayer.Name & vbNewLine
                   Next
                End If
             End If
             Call MsgBox("Loaded Fdo-Layers: " & vbNewLine & tLoadedFdoLayer)
          Catch ex As Exception
             Call MsgBox("<Your ErrMsg>")
          End Try
       End Sub
    
    End Class

     

     

    HTH, - alfred -

    -------------------------------------------------------------------------
    Alfred NESWADBA
    Ingenieur Studio HOLLAUS ... www.hollaus.at
    -------------------------------------------------------------------------
    Please use plain text.
    Contributor
    khushboo.singh
    Posts: 20
    Registered: ‎11-09-2011

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-09-2012 05:42 AM in reply to: alfred.neswadba

    You asked me to add a reference as
    Autodesk.Map.Platform.dll

    But I don't have any such dll present in the AutoCAD install folder as well as ARX folder.

    Could you please where would I get these dlls?

    I am using AutoCAD Map 3D 2012.

    Here I get Map object as Autodesk.Gis.Map.

    But I am not able to find Platform in Gis.Map

    Please use plain text.
    *Expert Elite*
    Posts: 6,432
    Registered: ‎06-29-2007

    Re: Conversion of AutoCAD Map 2008 VB code to AutoCAD Map 3D VB.NET code

    07-09-2012 09:10 AM in reply to: khushboo.singh

    Hi,

     

    >> You asked me to add a reference as Autodesk.Map.Platform.dll

    >> But I don't have any such dll

    I have it in my installation-folder C:\Program Files\Autodesk\AutoCAD Civil 3D 2012 (you will have a Map-directory instead of my Civil one, but the file should be there.

     

    - alfred -

    -------------------------------------------------------------------------
    Alfred NESWADBA
    Ingenieur Studio HOLLAUS ... www.hollaus.at
    -------------------------------------------------------------------------
    Please use plain text.