.NET

Reply
Valued Contributor
muthineni
Posts: 73
Registered: ‎10-10-2011
Message 1 of 4 (275 Views)

VBA to VB.net

275 Views, 3 Replies
12-27-2011 08:09 PM
I have created a macro using VBA which is working fine and after that i have written the same logic in VB.net and that DLL is giving lot of errors. Is there any way that i can use the vba code as it is in VB.net? Thank you.
*Expert Elite*
Jeff_M
Posts: 4,472
Registered: ‎07-22-2003
Message 2 of 4 (273 Views)

Re: VBA to VB.net

12-27-2011 08:17 PM in reply to: muthineni

"As it is"? No. There are many differences between VBA & VB.NET. THey ARE similar, and you may be able to get your code to work with minimal effort. But you may get more help if you post the code you are trying to get to work, as well as posting what the errors are you are getting.

Jeff_M, also a frequent Swamper
Moderator
Alexander.Rivilis
Posts: 1,449
Registered: ‎04-09-2008
Message 3 of 4 (258 Views)

Re: VBA to VB.net

12-28-2011 01:23 AM in reply to: muthineni

Useful link: http://through-the-interface.typepad.com/through_the_interface/2010/05/more-translated-autocad-vba-t...


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Member
beeb.pm.Net
Posts: 3
Registered: ‎01-07-2012
Message 4 of 4 (193 Views)

Re: VBA to VB.net

01-07-2012 10:08 PM in reply to: muthineni

To start with, get the thisdrawing equivalent using .net

Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common

Private Shared ReadOnly Property ThisDrg() As AcadDocument
        Get
        Return Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument
        End Get
    End Property

 Most of the VBA codes can be accessed though ThisDrg property

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!