Using OpenSTAAD in VB.NET

Hi! I already tried using OpenSTAAD in VBA. This is quite straightforward, coming from the OpenSTAAD documentation pdf.

I am trying to apply OpenSTAAD in VB.NET. I am quite new in VB.NET and having difficulty in shifting from VBA to VB.NET. Can anybody show how to use OpenSTAAD in VB.NET? It would be good if anyone can show me example lines of the code like instantiating OpenSTAAD in VB.NET. Thanks in advance.

Ed

  • Ed,

    If you're not developing a commercial product nor trying to write a code for a commercial developer  - you'd rather stay with old VB ...

    ...There is so much in VB.NET that you shall learn and implement for the sake of  "unification/standardization" and "seamless interoperability" with codes written in different .NET languages.

    If your works are limited to yourself and your 'user' office  - great chances are - you don't need .NET whatsoever

    Cheers

    Len

  • Hi Len,

    Not much encouragement there!

    Apparently, I am involved (although just new) with development of interoperability across different CAD softwares and analysis softwares such as rhino (grasshopper), etabs, etc which would help design optimization processes. Basically, other colleagues has done this already on the VB.NET platform. So I only need to incorporate the STAAD interoperability.

    I would gladly welcome any inputs to how I can apply OpenSTAAD in VB.NET.

  • Good news! I was able to instantiate OpenSTAAD in VB.NET.

    I am in the process of extracting node numbers and node coordinates for a given STAAD model.

    And this is written in VBA as:

    objOpenSTAAD.GetAllNodesCoordinates pnNodeNumbers(0), pX(0), pY(0), pZ(0)

    In VB.NET, I wrote it as:

    objOpenSTAAD.GetAllNodesCoordinates(pnNodeNumbers(0), pX(0), pY(0), pZ(0))

    Basically I am following the syntax of OpenSTAAD in VB.NET object viewer shown as follows:

    Function GetAllNodesCoordinates(ByRef pnNodeNumbers As Integer, ByRef pX As Double, ByRef pY As Double, ByRef pZ As Double) As Integer

        Member of OPENSTAADLib.IOutput

    I am encountering a FatalExecutionEngineError on this line. Has anybody encountered this or possibly knows how to write GetAllNodesCoordinates in VB.NET?

  • Hi Ed,

    I have a document on the use of OPENSTAAD functions with C#. I have been told that the method is very similar to VB.Net. I ahve uploaded this for you. Hopefully, this will help you on this issue.

    Sudip Narayan Choudhury

  • Sudip,

        With C#,  I am using OpenSTAAD 1.0 Type Library and do not have OpenSTAADUI in my COM reference list.  Using the Type library, I can open a file and get the node count. I can not, however, GetAllNodesCoordinates.

    Ed,

         Were you able to get the Nodes and their coordinates in VB.NET?