<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert vba codes to vb.net in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11373050#M11924</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks a lot for replying,&lt;/P&gt;
&lt;P&gt;Could you please give a simple example to run vba code through .net ?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;, you might misunderstand what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11839247"&gt;@ntclmain&lt;/a&gt;&amp;nbsp;has said: you CANNOT "run vba code through .net". You must use a .NET IDE (e.g. Visual Studio 20xx) to start a .NET Framework class library project and write the .NET code, which can be "very closed" line-by-line vba translation, if you do know both VBA and VB.NET well. However, since AutoCAD .NET API is quite different from AutoCAD COM API (which is used by AutoCAD VBA), closedly line-by-line translation may or may not work as expected in the .NET project; and even it works, it is not a best approach of doing it, in most cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if you do have mission-critical VBA code that needs to be migrated/converted to AutoCAD .NET API code, re-writing is a better term to describe what you need to do, which means you need to know/learn AutoCAD .NET API well enough. As long as you fully understand what the VBA code does to AutoCAD, I'd suggest to forget VBA code, and do the .NET API code with C# rather than VB.NET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 11:37:42 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2022-08-22T11:37:42Z</dc:date>
    <item>
      <title>Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11372875#M11921</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have some modules in vba and I intend to migrate from vba to vb.net , I haven't had much experience with .Net programming, and also I extremely need to perform a project with vb.net which I have written it with vba already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, my question is that is it possible to put vba codes in vb.net as it is and then compiling to DLL ??&lt;/P&gt;&lt;P&gt;Or I should translate line by line ?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:33:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11372875#M11921</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-22T10:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11372965#M11922</link>
      <description>&lt;P&gt;You can utilize the&amp;nbsp;COM Interoperability (.NET)&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-BFFF308E-CC10-4C56-A81E-C15FB300EB70" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-BFFF308E-CC10-4C56-A81E-C15FB300EB70&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Com interop code is nearly the same as VBA, except:&lt;/P&gt;&lt;P&gt;- No "ThisDrawing" is declared by default. You should call it through .NET API active document&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
............
ThisDrawing = TryCast(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.GetAcadDocument, IAcadDocument)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- "Set" keyword is not valid&lt;/P&gt;&lt;P&gt;-&amp;nbsp; You should imports some libraries so that your keyword, function in VBA can work in VB.NET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Imports System
Imports System.Math
Imports System.Text
Imports System.Linq
Imports System.Array
Imports System.IO
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports System.Management
Imports System.Security.Permissions
Imports System.Security
Imports System.Reflection
Imports System.ComponentModel
Imports System.Runtime.CompilerServices

Imports Autodesk.AutoCAD.Interop 
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Interop.Common.AcSelect

Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput

Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
Imports Autodesk.AutoCAD.ApplicationServices.DatabaseExtension
Imports Autodesk.AutoCAD.ApplicationServices.DocumentCollectionExtension
Imports Autodesk.AutoCAD.ApplicationServices.TabbedDialogExtension&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my favorite import list, some are&amp;nbsp; not necessary in your case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;*&lt;BR /&gt;You can find more information here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/2010/05/more-translated-autocad-vba-to-vbnet-migration-devtvs.html" target="_blank" rel="noopener"&gt;https://www.keanw.com/2010/05/more-translated-autocad-vba-to-vbnet-migration-devtvs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/visual_basic/" target="_blank" rel="noopener"&gt;https://www.keanw.com/visual_basic/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 10:51:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11372965#M11922</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2022-08-22T10:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11373019#M11923</link>
      <description>&lt;P&gt;Thanks a lot for replying,&lt;/P&gt;&lt;P&gt;Could you please give a simple example to run vba code through .net ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:19:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11373019#M11923</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-22T11:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11373050#M11924</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks a lot for replying,&lt;/P&gt;
&lt;P&gt;Could you please give a simple example to run vba code through .net ?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;, you might misunderstand what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11839247"&gt;@ntclmain&lt;/a&gt;&amp;nbsp;has said: you CANNOT "run vba code through .net". You must use a .NET IDE (e.g. Visual Studio 20xx) to start a .NET Framework class library project and write the .NET code, which can be "very closed" line-by-line vba translation, if you do know both VBA and VB.NET well. However, since AutoCAD .NET API is quite different from AutoCAD COM API (which is used by AutoCAD VBA), closedly line-by-line translation may or may not work as expected in the .NET project; and even it works, it is not a best approach of doing it, in most cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if you do have mission-critical VBA code that needs to be migrated/converted to AutoCAD .NET API code, re-writing is a better term to describe what you need to do, which means you need to know/learn AutoCAD .NET API well enough. As long as you fully understand what the VBA code does to AutoCAD, I'd suggest to forget VBA code, and do the .NET API code with C# rather than VB.NET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:37:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11373050#M11924</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-08-22T11:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11377821#M11925</link>
      <description>&lt;P&gt;Great, thank you both, I could translate a simple vba program to .net with Com&amp;nbsp;Interop so easily.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;Now, I want to add a form to this DLL so that user enter the values into the textboxs like vba's userform.&amp;nbsp;&lt;BR /&gt;Is it as easy as creating vba's userforms ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd appreciate it if you could help me with it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 10:44:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11377821#M11925</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-24T10:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11378492#M11926</link>
      <description>&lt;P&gt;When doing AutoCAD .NET API, you can do UI much easier than in VBA: you can use either Windows Forms, or WPF to build UI with richer user experience.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;has a very helpful &lt;A href="https://gilecad.azurewebsites.net/UserInterfaces.aspx" target="_blank" rel="noopener"&gt;tutorial here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, translating VBA code in .NET API with COM interop is not a good practice, unless the task is very simple, needed urgently, or temporary. The biggest issue of this practice is the solution is tied to AutoCAD version because of the reference to the COM interop, while pure .NET API solutions would work for multiple AutoCAD versions (since Acad2013) in most cases. In Acad .NET API solution, if the case warrants to use COM API, the good practice would be to use late binding when it is possible.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 14:52:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11378492#M11926</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-08-24T14:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379354#M11927</link>
      <description>&lt;P&gt;You're right,&amp;nbsp;&lt;BR /&gt;I checked it out on the another version of Autocad, it didn't workd. As you mentioned I should work with C# and pure&amp;nbsp;&lt;SPAN&gt;.NET API.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks for your sincerely helping.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 22:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379354#M11927</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-24T22:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379693#M11928</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please explain more about the bold line?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Again, translating VBA code in .NET API with COM interop is not a good practice, unless the task is very simple, needed urgently, or temporary.&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;STRONG&gt; The biggest issue of this practice is the solution is tied to AutoCAD version because of the reference to the COM interop&lt;/STRONG&gt;&lt;/FONT&gt;, while pure .NET API solutions would work for multiple AutoCAD versions (since Acad2013) in most cases. In Acad .NET API solution, if the case warrants to use COM API, the good practice would be to use late binding when it is possible."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;For me, I have converted 2 VBA projects to Com interop.&amp;nbsp; The target AutoCAD is 2015 to 2023 64 bit.&amp;nbsp; I didn't involve in big errors regarding specific AutoCAD version tie, except:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp; A call to AcadDocument.Application&amp;nbsp; caused fatal error in 2021 version&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp; If multi AutoCAD/ AutoCAD based-products instances of the same version are opening, then the GetObject() function will only return the first active instance, not the instance that fired the macro;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't have .NET experiences with 32 bit AutoCAD and 64 bit AutoCAD below 2015 versions.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there anything I've missed?&lt;BR /&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 03:29:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379693#M11928</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2022-08-25T03:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379936#M11929</link>
      <description>&lt;P&gt;This is a simple code which I've translated with&amp;nbsp;&lt;SPAN&gt;COM interop (VS 2015, .Net wizard 2017 and ObjectARX 2017) and it only works with Autocad 2017 :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Imports System
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Interop.Common.AcSelect
Imports Autodesk.AutoCAD.ApplicationServices.DatabaseExtension
Imports Autodesk.AutoCAD.ApplicationServices.DocumentCollectionExtension
Imports Autodesk.AutoCAD.ApplicationServices.TabbedDialogExtension

&amp;lt;Assembly: CommandClass(GetType(AutoCAD_VB_plug_in1.MyCommands))&amp;gt;
Namespace AutoCAD_VB_plug_in1
    Public Class MyCommands

        &amp;lt;CommandMethod("MyCommand", CommandFlags.Modal)&amp;gt;
        Public Sub MyCommand()

            Dim circleObj As AcadCircle
            Dim ThisDrawing As Object
            Dim centerPoint(0 To 2) As Double
            Dim radius As Double

            ThisDrawing = TryCast(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.GetAcadDocument, IAcadDocument)
            radius = 5.0#
            ' Create the Circle
            centerPoint = ThisDrawing.Utility.GetPoint(, "insertion: ")
            circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
        End Sub
    End Class
End Namespace&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said it works on Autocad 2017 fine, but it gives this error with Autocad 2018 :&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot (129).png" style="width: 371px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1107824i18E6F92E1B69B6A3/image-dimensions/371x280?v=v2" width="371" height="280" role="button" title="Screenshot (129).png" alt="Screenshot (129).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 06:47:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11379936#M11929</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-25T06:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11381099#M11930</link>
      <description>&lt;P&gt;The code you posted last doesn't have a need for interop. As others have said, if you want to use the COM api and have it be used with multiple versions then you may need to look into late binding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise here is your code using just the managed .NET API - Simple Circle Command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;CommandMethod("MyCommand")&amp;gt;
        Public Sub MyCommand()

            'Get your Document, Editor, and Database
            Dim aDoc As Document = Application.DocumentManager.MdiActiveDocument
            Dim ed As Editor = aDoc.Editor
            Dim db As Database = aDoc.Database

            'Prompt for Point
            Dim opt As New PromptPointOptions(vbCrLf &amp;amp; "Select Center Point: ")
            Dim res As PromptPointResult = ed.GetPoint(opt)
            If res.Status &amp;lt;&amp;gt; PromptStatus.OK Then
                Exit Sub
            End If

            'Create your Circle
            Dim circle As New Circle(res.Value, Vector3d.ZAxis, 5.0)

            'Create a Transaction
            Using tr As Transaction = db.TransactionManager.StartTransaction
                'Get the block table and the block table record for the modelspace
                Dim blkTbl As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForRead)
                Dim blkTblRec As BlockTableRecord = tr.GetObject(blkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite)

                'Append the new circle entity
                blkTblRec.AppendEntity(circle)

                'Let the transaction know about it
                tr.AddNewlyCreatedDBObject(circle, True)

                'Commit your transaction. This is often forgotten.
                tr.Commit()
            End Using
        End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11381099#M11930</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2022-08-25T15:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11381240#M11931</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've create a new project with Visual studio 2019, with references to AutoCAD 2022 interop libraries, Net framework version 4.8&amp;nbsp;&lt;BR /&gt;I copied your code &amp;amp; build a .dll file&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ntclmain_0-1661444943861.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1108060i3E5B4A65C501EC2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ntclmain_0-1661444943861.png" alt="ntclmain_0-1661444943861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The .dll file (Project_Test_No01.dll) works fine with AutoCAD 2022 and 2016 version.&lt;/P&gt;&lt;P&gt;*&lt;BR /&gt;I've attached my test project.&amp;nbsp; You can find the compiled .dll in:&amp;nbsp;&lt;EM&gt; ...AutoCAD_VB\Project_Test_No01\bin\Debug&amp;nbsp;&lt;/EM&gt; folder&lt;/P&gt;&lt;P&gt;Remember to &lt;STRONG&gt;unblock&lt;/STRONG&gt; the .dll file before testing in AutoCAD 2017 &amp;amp; 2018&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;In this case:&lt;/P&gt;&lt;P&gt;It seems that 2022 interop version provides backward compatible ability&lt;/P&gt;&lt;P&gt;while&amp;nbsp; 2017 interop version is not forward compatible with 2018 (same .NET framework version 4.6)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 16:41:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11381240#M11931</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2022-08-25T16:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11384098#M11932</link>
      <description>&lt;P&gt;I loaded the DLL which you have created, as you said it works fine on Autocad 2015 to 2022. I tried to create my own DLL with vs 2019 and Autocad 2022 (Net Framework 4.8) but it only works&amp;nbsp; with Autocad 2022 and returns the same error on the other versions like 2020 :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot (132).png" style="width: 300px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1108673iFAF11E4966FFD5EE/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screenshot (132).png" alt="Screenshot (132).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm puzzeld as my project is exactly the same as your project in terms of Autocad, ObjectARX and Visual studio versions, I also compiled your project again and it works with older versions but mine not. (I attached my project)&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 20:24:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11384098#M11932</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-26T20:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11385107#M11933</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7889601"&gt;@bahman.jf.68&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Your description is true.&lt;BR /&gt;I also received that error message in 2016 version after correcting reference path (for my PC ) &amp;amp; rebuild your project&lt;BR /&gt;*&lt;BR /&gt;After changing some reference file settings (as images below), I saved &amp;amp; rebuilt your project, the macro worked again in 2016 version.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ntclmain_0-1661618994301.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1108835i2A5D4D6166DDEC6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ntclmain_0-1661618994301.png" alt="ntclmain_0-1661618994301.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ntclmain_1-1661619012109.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1108836iC6A000358A2C2109/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ntclmain_1-1661619012109.png" alt="ntclmain_1-1661619012109.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;*&lt;BR /&gt;I attached the edited project below.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2022 16:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11385107#M11933</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2022-08-27T16:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11386130#M11934</link>
      <description>&lt;P&gt;Great, thanks mate, my problem has been resolved.&lt;BR /&gt;I have three questions :&lt;BR /&gt;- Do I have to compile it for 32 bit apart from this DLL ?&lt;BR /&gt;- Is any difference between COM interop and Pure .Net in terms of speed of running codes in Autocad and compatibility of all systems ?&lt;BR /&gt;- As a vba programmer it's hard to me for learning and creating DLL with Transactions and .Net pure codes, therefore could I trust COM interop method forever or at least for a while?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 15:10:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11386130#M11934</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2022-08-28T15:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert vba codes to vb.net</title>
      <link>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11386225#M11935</link>
      <description>&lt;P&gt;&lt;SPAN&gt;1. Do I have to compile it for 32 bit apart from this DLL ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Yes, if you use COM interop, you need to compile the 2 separate .dll files for using in 32 bit and 64 bit AutoCAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://forums.autodesk.com/t5/net/32-bit-c-net-plugin-for-64-bit-autocad/td-p/4539709" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/32-bit-c-net-plugin-for-64-bit-autocad/td-p/4539709&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Is any difference between COM interop and Pure .Net in terms of speed of running codes in Autocad and compatibility of all systems ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;About the speed .NET API (pure .Net) is much faster than COM interop.&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Also VBA speed in 64 bit version is much slower than COM interop.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://forums.autodesk.com/t5/net/code-excecution-time-comparison-net-api-net-com-interop-and-vba/m-p/11071966" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/code-excecution-time-comparison-net-api-net-com-interop-and-vba/m-p/11071966&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;SPAN&gt;3. As a VBA programmer it's hard to me for learning and creating DLL with Transactions and .Net pure codes, therefore could I trust COM interop method forever or at least for a while?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Look at 2, you will have&amp;nbsp;motivation to use .NET API&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;However, when coming from VBA,&amp;nbsp; .NET interop may be a reasonable option when you have little time. I found that the code works fine (at least for&amp;nbsp; 64 bit AutoCAD version), the speed is nearly the same as VBA in 32 bit AutoCAD version.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;After familiar with Visual studio environment, VB.Net language ... you will find it easier to move up to .NET API;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 16:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/convert-vba-codes-to-vb-net/m-p/11386225#M11935</guid>
      <dc:creator>ntclmain</dc:creator>
      <dc:date>2022-08-28T16:47:52Z</dc:date>
    </item>
  </channel>
</rss>

