1

I have tried to use the ETABS dll file in MATLAB. The documentation explains how to use the dll file in .net languages. By changing the code I can use it in matlab, but there is some error.

My code:

 asm = NET.addAssembly('C:\Program Files\Computers and Structures\ETABS 2013\ETABS2013.dll')
 ETABSAssembly = System.Reflection.Assembly.LoadFrom('C:\Program Files\Computers and Structures\ETABS 2013\ETABS.exe')
 ETABSObject = ETABSAssembly.CreateInstance('CSI.ETABS.API.ETABSObject')

and the output for the last line is:

ETABSObject = 

  CSI.ETABS.API.ETABSObject handle with no properties.
  Package: CSI.ETABS.API

  Methods, Events, Superclasses


Superclasses for class CSI.ETABS.API.ETABSObject:

    System.MarshalByRefObject
    System.Object
    handle
    ETABS2013.cOAPI

after that I must convert the object to ETABS2013.cOAPI which is a abstract class, by using the cast operator as follows:

a = cast(ETABSObject,ETABS2013.cOAPI)

But I get the following error:

??? Error using ==> ETABS2013.cOAPI
Creating an instance of the Abstract class 'ETABS2013.cOAPI' is not allowed.

How to convert the Etabs object to cOAPI?

1 Answer 1

0

I don't think cast does what you are trying to do. It only works on built-in data types.

I also don't think you can cast to ETABS2013.cOAPI using any technique. Abstract classes are abstract; you can't have an object of that type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.