Skip navigation
7815 Views 19 Replies Latest reply: Feb 4, 2011 10:28 PM by BongTallorin RSS
Debayan Copper 11 posts since
Jan 17, 2011
Currently Being Moderated

Jan 17, 2011 8:56 PM

Using Scripts in MathCAD (VB Script?) for foundation design calculation

A Big Hello to all fellow Civil & Structural Engineers!


I had thought that I should put this question in 'Programming & Extending MathCAD' discussion, but then I thought against it and decided to put this question here.


I thought I will just explain it the way it is in a language that fellow engineers will understand.


Bascially what I have is this


1) STAAD output of support reactions in MS excel worksheet.

2) MathCAD 15.0


Now what I want to do is


1) To script a code (please let me know whether I can do this without a code too) and run a loop so that it automatically pastes each and every node and load case number one by one in a particular variable by reading the following from the excel sheet.


2) As and when the node no and LC is getting pasted, the variables which I have assigned for forces like FX,FY and FZ should change automatically (The values of FX, FY and FZ will be read from the excel sheet)


3) Assuming that I have just one check , whose output is 'Safe' and 'Unsafe' should be tabulated in an array form for each and every load case and node no


4) I should be able to display the most critical LC and node no combination for documentation purposes.


I hope that I have not jumbled up all of this. Any help will be appreciated. I have done this in VB Macro in excel and am just shifting to MathCAD thus this long question.




  • MikeArmstrong Diamond 4,547 posts since
    Dec 3, 2008

    Welcome to the forum.


    Can you provide the Excel sheet and maybe the Mathcad sheet, to see how far you have got. You could also provide examples of the results you expect to obtain for clarity.



      • MikeArmstrong Diamond 4,547 posts since
        Dec 3, 2008

        I think I'm sure I know what your after. It seems that you have extracted the values from the data incorrectly.


        Are the values to be summated for each node found on the right hand side of the corresponding node number? (Columns 1 - 6)



      • MikeArmstrong Diamond 4,547 posts since
        Dec 3, 2008

        Something like the attached?



          • MikeArmstrong Diamond 4,547 posts since
            Dec 3, 2008
            But there is also one additional thing, the node number should be user editable, means if in the summary sheet if I see unsafe then I should be able to enter that node number somewhere in the sheet so that the I can review the actual calculation and see where it has failed.

            Will the attached help?


            I have added an extract function which loops through all elements of Evaluation and checks for the condition 'Unsafe' and then returns the original input data, in order for it to be checked. Is this what you had in mind?


            Also the whole programming looks a bit greek to me , I know it is asking for much but could you please explain what your program does...coz If someone asks me, how this sheet functions then I will have to reply "Go and ask Mike!"


            I will write some notes and re-post a bit later if that's ok?


            1) Why can't I view the table in totality?

            2) How do I make MathCAD recognize the Book1.xls file to read the contents if it is not located on desktop?


            If you double left click and set the 'Matrix display options' under the display tab to Matrix you should be able to see it.


            To change the path of the component, right click and select properties and browse for your file.


            Hope this helps.



          • MikeArmstrong Diamond 4,547 posts since
            Dec 3, 2008

            Notes added to the worksheet. Hope you can understand it.



More Like This

  • Retrieving data ...

Bookmarked By (0)


  • Correct Answers - 3 points
  • Helpful Answers - 1 points