OpenSTAAD | OSLoadUI::AddSelfWeightInXYZ

I'm using STAAD.Pro Script Editor and OpenSTAAD to generate a structural model. I noticed that the command OSLoadUI::AddSelfWeightInXYZ, parameter varInDirection works properly using the self weight direction index 1, 2, 3 for X, Y, Z, respectively instead of 4, 5, 6 for X, Y, Z, respectively.

Is Bentley Software / Technical Group is aware or been notified about this bug / error? Is there a revised / newer version of OpenSTAAD Library? Any help will be much appreciated. 

VARIANT OSLoadUI::AddSelfWeightInXYZ ( const VARIANT FAR &  varInDirection,
const VARIANT FAR &  varLoadFactor 
)

Adds a self weight to the active load case.

Parameters
[in] varInDirection Self weight direction index (= 4, 5, 6 for X, Y, Z, respectively).
[in] varLoadFactor Multiplying factor for self-weight.

Change to:

[in] varInDirection Self weight direction index (= 1, 2, 3 for X, Y, Z, respectively).
Return values
0 OK.
-1 General error.
-8002 Load Case not found.
-8004 Library Error: Unable to add self weight.
C++ Syntax
// Add self weight in Y direction with factor -1.0
VARIANT RetVal = OSLoadUI::AddSelfWeightInXYZ(2, -1.0);
VBA Syntax
1 ' Add self weight in Y direction with factor -1.0
2 Dim RetVal As VARIANT = OSLoadUI.AddSelfWeightInXYZ(2, -1.0)
Parents
  • You are right about the factor, Denisson. For this OpenSTAAD function, you need to specify the direction as 1, 2 or 3 to add self weight in X, Y or Z direction. The direction information mentioned in the manual is incorrect and needs to be modified.

    One suggestion, most of the direction numbers (used in the OpenSTAAD functions) are mentioned incorrectly in the manual, whether that is to add any load, extract any results or assign any specifications. I have posted few issues in the past and requested the QA team to thoroughly check the manual, but most of these problems are not fixed yet. So my suggestion is to cross check the direction numbers mentioned in the manual with a trial code and then use it in the actual code - this is normally what I follow.



  • Thank you for your quick response.

    I ran the code using these numbers and worked perfectly.

    Yes, as long we provide documentation of these bugs in the Bentley Community all the end-users can benefit from it. It would be great if Bentley provides more examples for each function in the OpenSTAAD library.

    I look forward to see the revised version of OpenSTAAD library.

    Best regards,

    Denisson

Reply
  • Thank you for your quick response.

    I ran the code using these numbers and worked perfectly.

    Yes, as long we provide documentation of these bugs in the Bentley Community all the end-users can benefit from it. It would be great if Bentley provides more examples for each function in the OpenSTAAD library.

    I look forward to see the revised version of OpenSTAAD library.

    Best regards,

    Denisson

Children
No Data