- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @torben_schroederXDK86. I'm glad that I was able to help you develop a working solution.
Using VBA (Visual Basic for Applications) is not really frowned upon. It is just highly recommended (not just by me, but by the majority of the coding/automation community) that, because VBA has not been maintained in several years, and there are newer/better options readily available to us, that any 'new' automation solution development be done using one of the newer systems. Since Inventor's iLogic system has been around for a great many years now, and it has been using the newer VB.NET coding language for most of those years, it just seems like the next logical step in that direction. And since VB.NET sort of shares some of the same ancestry as VBA, stepping forward into VB.NET is 'relatively' easy. Likely easier for those with less experience using VBA, than for those with lots of experience using it. Many of the VBA sample programs that Autodesk has published in its online help, can be pretty easily converted to VB.NET so that they can be used in iLogic rule, by removing certain keywords (such as 'Set', 'Let', & 'Call'), and fixing a few minor formatting differences. VB.NET also lets you 'declare' and 'set' the value of a variable naturally in one line, while VBA generally requires 2 lines, so equivalent vb.net code is often shorter, or requires less code. There are too many differences & benefits to mention here. VB.NET offers many new features/functionality that were not present back in the VBA era also (Link). If you look at the history of VB.NET versions, there have been several 'branches' of it (Standard, Framework, Core), and lots of versions over the years, so it is not actually that 'new', just 'newer' than VBA. In fact, even the VB part of VB.NET may be nearing the end of its 'new development' phase, while other forms of the .NET platform (C#.Net, F#.NET, ASP.NET, and others) will likely continue forward if VB development ceases.
Yes, it is common or forum users to post the final code that they consider to be 'the solution' to their question/problem/challenge. However, it is not necessarily required. If your finished/final code contains anything that is personal/confidential/proprietary, then you can either change that part to something 'neutral/generic' or simply not post it at all, if you do not want to. It is relatively common for someone else to find a forum topic that closely matches what they are searching for, and appears to be 'solved', but the 'solution' is not included in the forum discussion, so they may ask for the solution to be posted, so they can benefit from it, or use it themselves to further their own automation goals. Some folks may simply not visit this forum much after asking a question and getting an answer though, so it is very possible that the 'solution' may never get posted, it was not posted originally. And yes, if you eventually post your own 'solution' to your own question/problem/challenge, it is OK to mark your own forum reply as the/a 'accepted solution'.
Wesley Crihfield
(Not an Autodesk Employee)