Sample VB.NET Addin Project?

I've seen a couple post on this with some sample code, but I was hoping someone has an actual basic VB.NET project that works as an add-in for v8i. If so, is there anyway that you could zip it and place it here for others to download? I've tried following the examples here, but my VB 2010 keeps spitting back errors.

Thank you.

  • Hi,

    what error do you receive? I have no any VB.NET project available as C# is my choice for NET addins, but addins for MicroStation are quite simple, so I suppose it would not be complicated to find where the problem is ... and it's more valuable from learning point of view ;-)

    With regards,

     Jan

  • I have C# and write in it as needed. If you have a sample C# addin app or can point me to one, that would be great. We are currently running barmenu.ma for our custom menu items. We are moving to v8i and I need to replace barmenu and I would prefer to write the solution ourselves. If I had the basics on how to get a addin to work with Microstation, then I can probably can take it from there.

    Thanks

  • First thing to check with Visual Studio(VS) 2010 is the version of the .NET framework. VS 2010 defaults to .NET framework 4.0, but MicroStation only supports up to version 3.5.

    Rod Wing
    Senior Systems Analyst

  • Even though I'm using VS2010 for all my non-MicroStation programming I've left all my addin projects in VS2008.

    If you could post the error messages that would be a good place to start.

    Also, what .NET framework are you targeting with your addin? I'm pretty sure 4.0 will not work but not sure, all my stuff is still targeting 3.5.

  • Visual Studio 2010 works as the tool for MicroStation addins pretty well, but exactly as RodWing wrote, for new projects the target platform has to be changed to .NET 3.5.

     Jan

  • There is a wizard for developing addins that is delivered as part of the MicroStationSDK for MicroStation V8i Select Series 3.  I would recommend starting with that as how to develop for C# or VB.NET (it does C++ but I don't like that template much, and yes I wrote the template).  The instructions are in the MicroStation Programmers Guide.  I have attached a simple VB.NET Addin that shows a form and not much else for you to review ( I think this is a repost from another thread).  As for replacing Barmenu have you looked at just using the Customize tools in MicroStation?  We have a MDF to XML utility to import your Barmenu definition file and if you don't like that it is very easy to create a menu or set of tools that replace Barmenu.  I have worked with a few people on replacement strategies and they have been happy to use the Customize app to build the user interface.  It is well documented and it is using the same tools that are used to build MicroStation UI.

    HTH,

    VBDemoApp.zip
  • Wow, many responses and thank you for the responses.

    The errors I was receiving had to do with calling the Bentley Imports, it said they did not exist... although I had referenced in the Bentley DLL's I had seen others use here.

    I am using NET 4.0. Didn't realize the it would be a problem. I'm not real sure how to force VS 2010 to use 3.5.

    Should I move back to VS 2008 if that is what everyone else is using?

    As far as importing our barmenu def file, I would prefer not to use a DGNLIB. Then I'm stuck using VBA and it has to many limitations.

    Thank you for the sample app. I will take a look at it. I had heard about the wizard, but checked my SDK directory and could not find it.

    I'm beginning to wonder if I need to download a newer version of v8i and SDK, then re-install.

  • Unknown said:
    I'm not real sure how to force VS 2010 to use 3.5.

    Go to Project > Project properties... (probably last item in menu), tab Compile > Advanced Compile Options... > Target framework.

    It's important to set the corret target NET version, because 2.0 - 3.5 is based on the same "engine", but NET 4.0 is new and not backward compatible. MicroStation is based on 2.0, so you can you anything from 2.0 to 3.5.

    Unknown said:
    Should I move back to VS 2008 if that is what everyone else is using?

    No, Visual Studio projects, as far as I know, are not backward compatible, so if you want to move back to older version, you have to create the new project in 2008 and copy all files manually.

    Unknown said:
    As far as importing our barmenu def file, I would prefer not to use a DGNLIB. Then I'm stuck using VBA and it has to many limitations.

    Ohhh ... why? If you don't use DGNLIB, you will lost ... well ... all features related to MicroStation customization and administration.

    Why do you think there is a relation between VBA and DGNLIB? BTW NET is in fact the same COM interface as VBA use, so there is nearly no difference between MicroStation VBA and NET API.

    Unknown said:
    but checked my SDK directory and could not find it.

    It's included in V8i (SELECTseries 3) SDK, before it it was available separately.

    My (subjective and personal) opinion is addin structure is enough simple, so I prefere to create it myself or copy code snippets from older projects, because I want to know what each line of my code do ... which is not the case of any wizards.

      Jan

  • When I open the VBDemoApp.sln, none of the Bentley references are attached. When I try and re-attach them, I get an error that states "'ustation.dll', or one of it's dependencies, requires a later version of the .NET Framework than the one specified in the project."

    It is wanting me to change the project framework to NET 4.0.

  • I don't have any VB.NET project to test it, but I guess some reference are NET 4.0? Try to detach all referenced assemblies, change project target NET version and reference the assemblies again.

    In the worst case create the new VB.NET project with the correct .NET version and import or copy your existing vb files.

     Jan