Sir,
I am writing a openstaad code using visual basic and my objective is to assign a point load and moment at a group of nodes. Now after executing the code the point force is assigned properly in staad model but point moment is not reflected in staad. For your reference, i am adding the piece of code here and also the output screenshot.
For I = 2 To (j - 1) objOpenSTAAD.Load.SetLoadActive 1 objOpenSTAAD.Load.AddNodalLoad node(I), 0, (-1) * Cells(62 + I, 3), 0, 0, 0, Cells(62 + I, 4) Next I
staad output excel input
can you please help me how to fix this problem ASAP ?
Tank, I have posted several requests in the last few years to address these issues of the OpenSTAAD manual. Several problems has been fixed, also documentation of all the new functions now contain complete information including the variable type and a complete example (like, the parametric mesh generation functions). But still there are lots of issues present in the current manual and I am not aware of any timeframe when all these issues will be fixed.
Until all these issues are fixed, my only suggestion is to use this manual just to check the function name and arguments and use trial code to cross check the functionality (that is what I do). If you need any clarification, you can always contact us or post your query.
Surojit, thank you for being open and honest about the problems with the OpenSTAAD reference manual. I reported the problem with variable types not being given correctly back in March 2019. You responded that you would request that the development team include them in the manual. They obviously ignored your request. You seem like you want to help your customers so it must be very frustrating when your management doesn't feel something as basic as getting documentation correct important. I can tell you it's very frustrating for me and I ask myself every year when I approve the invoice to continue maintenance why am I sticking with Bentley?
understood sir, thats why using CDbl actually worked, which in turn make that value as "double". Thank you for your help
thank you sir, it works for me
Hi Arkadev,
Let me explain why your code is not working. When you import a value in your VBA code from any cell, by default the variable type is considered as Variant, it might be Variant/String or Variant/Double depending on the value. Now this variable type is not sufficient for any OpenSTAAD function. If you try to run any OpenSTAAD function with null or variant variable type, either it will not work or incorrect results will be extracted. That's why we always suggest to create a variable with proper variable type, assign the value to that variable and then use that variable in the OpenSTAAD function (this is the solution provided by Shreyanka).
Next question is, from where you get this variable type information. Ideally it needs to be mentioned in the manual but it is not. At this moment, you need to guess it depending on the data, for example, if there is any co-ordinate value or force component, the data type should be Double, for node or member number or load case, it should be Integer/Long etc.
Final information, what Tank mentioned in his reply is absolutely correct. The OpenSTAAD Help manual is an incomplete manual. There are lots of missing functions, variable types are not mentioned, description of several functions and variables are not correct, examples are missing and so on. You can use this manual to get the basic information, and then use your experience or trial and error method to write your code correctly. I always cross check the information provided in the manual with some trial code and then implement the function in the actual code.
Answer Verified By: Arkadev Ghosh