View previous topic :: View next topic |
Author |
Message |
rahul.leslie General Sponsor
Joined: 01 Apr 2008 Posts: 510 Location: Trivandrum
|
|
Back to top |
|
|
BVRAO General Sponsor
Joined: 21 Sep 2009 Posts: 53
|
Posted: Sat Aug 31, 2024 5:34 am Post subject: |
|
|
I have developed many applications for STAAD
I have not understand actually what is your requirement
you have to declare Excel also as an object
|
|
Back to top |
|
|
rahul.leslie General Sponsor
Joined: 01 Apr 2008 Posts: 510 Location: Trivandrum
|
Posted: Sun Sep 01, 2024 3:29 pm Post subject: |
|
|
Thank you, sir, for your response.
This is a VBA program written within Excel, so Excel need not be made an object... the program is itself residing inside Excel
My only doubt is, whether the function...
openSTAADObj.Geometry.GetNodeList
...is working fine, in your experience. In my case, with the VBA code given in above post, it is giving error, saying:
Run-time error '5'
Invalid procedure call or argument
where could I be wrong?
Rahul Leslie
|
|
Back to top |
|
|
JVCSNL ...
Joined: 26 Jan 2003 Posts: 169
|
Posted: Mon Sep 02, 2024 4:18 am Post subject: |
|
|
did you tried
openSTAADObj.Geometry.GetNodeList(nodesList)
Best Regards,
Jignesh Chokshi
|
|
Back to top |
|
|
rahul.leslie General Sponsor
Joined: 01 Apr 2008 Posts: 510 Location: Trivandrum
|
Posted: Mon Sep 02, 2024 2:14 pm Post subject: |
|
|
..tried. It isn't working either.
|
|
Back to top |
|
|
BVRAO General Sponsor
Joined: 21 Sep 2009 Posts: 53
|
Posted: Thu Sep 05, 2024 2:26 pm Post subject: |
|
|
rahul.leslie wrote: | ..tried. It isn't working either. |
who told " openSTAADObj " will be taken os an object in VBA
is there any examples you have
it is very easy to read the TEXT file like .STD .TXT . ANL in VBA
and load the contents whatever you want .
Thats why am asking what do you want to do
Definitely I will guide you , I developed so many applications long back in excel VBA
|
|
Back to top |
|
|
JVCSNL ...
Joined: 26 Jan 2003 Posts: 169
|
Posted: Fri Sep 06, 2024 4:12 am Post subject: Open STAAD |
|
|
Mr. Rao,
The OpenSTAADObj works well in VBA for sure. It actually allow us to access the entire database rather than .std text file or .anl file having limited information. It is better to use this object as it can be useful for updating the data within staad model itself through automation programs.
Dear Rahul,
The problem I see is that the nodelist is an array without defined dimension.
Since, we don't know how many nodes will be there in different models, it is necessary not to define its size in the first place.
Hence, we shall first define the variable without dimension (dim nodelist() as long in this case).
Then, we shall count the nodes and then redimension the variable with exact size.
Try Below code:
Dim nodesList() As Long
Dim nNodes As Integer
nNodes = openSTAADObj.Geometry.GetNodeCount
ReDim nodesList(0 to (nNodes-1)) As Long
openSTAADObj.Geometry.GetNodeList nodesList
alternatively:
Dim nNodes As Integer
nNodes = openSTAADObj.Geometry.GetNodeCount
Dim nodesList(0 to (nNodes-1)) As Long
openSTAADObj.Geometry.GetNodeList nodesList
I think, these both approaches shall work:
Sharing another example, for support nodes from one of my programs. Similar syntax.
Dim SupNode() As Long
Dim SC As Integer
SC = OST.Support.GetSupportCount
ReDim SupNode(0 To (SC - 1)) As Long
OST.Support.GetSupportNodes SupNode
Hope this works and your difficulty is solved.
Best Wishes,
Jignesh V Chokshi
|
|
Back to top |
|
|
rahul.leslie General Sponsor
Joined: 01 Apr 2008 Posts: 510 Location: Trivandrum
|
Posted: Sat Sep 07, 2024 9:46 am Post subject: |
|
|
ReDim nodesList(0 to (nNodes-1)) As Long
openSTAADObj.Geometry.GetNodeList nodesList
..wow, it worked 💪... thanks a lot, Jignesh sir 😊
I thought the GetNodeList function would re-dimension as well.
Rahul Leslie
|
|
Back to top |
|
|
BVRAO General Sponsor
Joined: 21 Sep 2009 Posts: 53
|
Posted: Sun Sep 08, 2024 6:33 pm Post subject: Re: Open STAAD |
|
|
[quote="JVCSNL"]Mr. Rao,
The OpenSTAADObj works well in VBA for sure. It actually allow us to access the entire database rather than .std text file or .anl file having limited information. It is better to use this object as it can be useful for updating the data within staad model itself through automation programs.
Thanks a lot
without knowing above OpenSTAADObj
I have developed lot of code for STAAD
|
|
Back to top |
|
|
|