objOpenSTAAD.Property.AssignBeamProperty Error

Hello all,

I'm trying to assign material to the beams in STAAD through VBA using the OpenSTAAD library.  However, when I try to assign the material to the beam through objOpenSTAAD.Property.AssignBeamProperty 7, 1  

I get the a Run Time error in Excel: "Run-time error '-214717851(80010105)   Automation error The server threw an exception"

Does anyone know why this error would come about? I'm new to the OpenSTAAD library, so if anyone could shed insight on this problem, that'll be great. 


My code is as follows: 

BusType= "4.00PipeX40"

objOpenSTAAD.Property.CreatePipePropertyFromTable 1, BusType, 0, 0, 0
objOpenSTAAD.Property.SetMaterialID 1
For b = 0 To Sheet16.Range("E11")
j = Cells(b + 14, 6).Value
k = Cells(b + 14, 7).Value
objOpenSTAAD.Geometry.AddBeam j, k

'assign bus material
If Abs(k - j) > 1 Then
objOpenSTAAD.Property.AssignBeamProperty 7, 1
End If
Next b

  • There are two problem in the model.

    First problem is --

    objOpenSTAAD.Property.CreatePipePropertyFromTable 1, BusType, 0, 0, 0

    This function does not generate the pipe section and no section has been added to the model. The reason is the incorrect section name. I presume that you want to add PIPE section PIPX40 from american database. The name that you have provided, there is no section present with this name. So no pipe section has been added to the model.

    The error message is due to the following function --

    objOpenSTAAD.Property.AssignBeamProperty 7, 1

    In this function program tries to assign property specified under reference 1 to member 7. As no section with reference number 1 has been added to the model, so this function throws an error message.

    You need to change the following --

    BusType= "PIPX40"

    If you want to add a standard section, provide only the section name available in standard section database.



    Answer Verified By: Anna Moss 

  • Is there a function that assigns material properties to the beams? I used Property.AssignBeamProperty and Property.AssignMemberSpecToBeam. However, whenever I click on the beams, I still need to manually assign material properties to the beams (Elasticity, Poisson, Density, Alpha, Damp). 

    Is there an OpenSTAAD function that can do it automatically?