Dec 31, 2018, 2:21 PM

Dear @Elisa ,

I am glad that you were able to create your own Python bindings, I hope it will make your work easier. ;)

Concerning the SBStructuralModel, it is exposed as SBMStructuralModel and can be found in Python bindings as follows: sam.Modeling.StructuralModel.StructuralModel. It is exposed like that:

py::class_<SBMStructuralModel, std::unique_ptr<SBMStructuralModel, py::nodelete>, SBMModel>(m, "StructuralModel")

Unfortunately, I cannot check right now the origin of the error you have. Could you, please, try adding into the exposure of your custom structural model the following: std::unique_ptr<MyCustomStructuralModel, py::nodelete>, where MyCustomStructuralModel is the name of your structural model class:

py::class_<MyCustomStructuralModel, std::unique_ptr<MyCustomStructuralModel, py::nodelete>, SBMStructuralModel>(m, "MyCustomStructuralModel")

See pybind11 documentation "Non-public destructors" section for more information. This might resolve your second issue as well.