DevTV: AutoCAD VBA to .NET Migration Basics

As mentioned in a comment on a recent post, Stephen Preston, our DevTech Americas Manager, has put together a useful tool and accompanying DevTV session to help people migrate their VBA code to VB.NET. The resultant code uses COM Interop to call into AutoCAD.

AutoCAD VBA to .NET Migration Basics view download (44.3 Mb)

Stephen considers this presentation, and the migration tool itself, to be in draft form. If you have feedback, please do send Stephen an email.

One response to “DevTV: AutoCAD VBA to .NET Migration Basics”

  1. One issue I have with those examples is that they fail to consider ActiveX events and the issues related to them, which makes the approach used in the sample code problematic.

    For those who would like to know more about emulating VBA's 'ThisDrawing' in VB.NET, including support for AcadDocument events, this may help:

    caddzone.com/VBA...

  2. Stephen Preston Avatar
    Stephen Preston

    Thank you Tony. I hadn't considered events for this first version of the demo. But you're right that its an important aspect of migration, and should be covered. I'll check out your example.

  3. Any objects we create using .net, references WCS even if we change UCS. this problem is not there in VBA. I have an old VBA project which reads 3D points from file & creates 3D objects from those points. this works well with VBA. but with VB.net this porgram doesn't work properly as it can't refer UCS
    is there any solution for this.

  4. Stephen Preston Avatar
    Stephen Preston

    Hi Srinivasan. I believe you're an ADN memebr, so you're welcome to ask specific questions via DevHelp Online on the ADN website.

    One way to convert from UCS to WCS is use the proporty Editor.CurrentUserCoordinateSystem to return a matrix that you can use as a transformation matrix between the current UCS and WCS.

    Did you have any feedback for me on the migration utility?

  5. Tony Tanzillo Avatar
    Tony Tanzillo

    "Any objects we create using .net, references WCS even if we change UCS. this problem is not there in VBA. I have an old VBA project which reads 3D points from file & creates 3D objects from those points. this works well with VBA. but with VB.net this porgram doesn't work properly as it can't refer UCS
    is there any solution for this."

    I don't believe this is a problem, if you are using the ActiveX API from VB.NET, because that is the same API used by VBA.

    The managed ObjectARX API is a different matter entirely, and there is no 'clean', simple, or reasonably straightfoward way to perform a conversion of existing VBA code to managed ObjectARX. In other words, migrating from VBA/ActiveX to managed ObjectARX generally entails a complete, from-the-ground-up rewrite.

    So, if your plan involves converting existing VBA code to managed ObjectARX, this would be just one of many dozens of hurdles, and of course, is really just a part of the learning process.

  6. Great information thanks for sharing this with us.In fact in all posts of this blog their is something to learn . your work is very good and i appreciate your work and hopping for some more informative posts . Again thanks for sharing.

  7. What happened to the original presentation by Stephen Preston. I would very much like to d/l this version.

  8. Hi Pete,

    My original recording was updated and replaced by Augusto's recording. I didn't keep a copy of my version. The latest version of the recording and the migration tool are linked to at the bottom of http://www.autodesk.com/vba.

    Cheers,

    Stephen

  9. Apex Park Square Avatar
    Apex Park Square

    Its really wonderful and watchable. I like to share it with all my friends and hope they will definitely like it.
    Visit- 1

Leave a Reply to Kris Valverde Cancel reply

Your email address will not be published. Required fields are marked *