ListBox with multiple parameters
ListBox with multiple parameters
(OP)
Hi there,
I am trying to optimize my work as a structural engineer, and create a file that has reduced input on my behalf.
I am currently looking for a solution to the following problem :
-I want to select the concrete class used (figured using a listbox ) ex: C12/15 , C16/20 , C20/25 etc
-class parameters should change based on selection.
Problem there are 14 parameters i need to include, and the listbox only allows for 1.
I was thinking of defining them in another mathcad file as vectors, and calling them out based on selection.
Is there any way i can do this?I'm using Mathcad 14.
Any suggestions would be greatly appreciated.I'm not that good at programming.
Thank you.
Best regards,
Dan
I am trying to optimize my work as a structural engineer, and create a file that has reduced input on my behalf.
I am currently looking for a solution to the following problem :
-I want to select the concrete class used (figured using a listbox ) ex: C12/15 , C16/20 , C20/25 etc
-class parameters should change based on selection.
Problem there are 14 parameters i need to include, and the listbox only allows for 1.
I was thinking of defining them in another mathcad file as vectors, and calling them out based on selection.
Is there any way i can do this?I'm using Mathcad 14.
Any suggestions would be greatly appreciated.I'm not that good at programming.
Thank you.
Best regards,
Dan





RE: ListBox with multiple parameters
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
[IMG http://tinyurl.com/7ofakss]
Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers
Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com: http://www.engineering.com/AskForum/aff/32.aspx
RE: ListBox with multiple parameters
Rem Add Strings here as needed
ListBox.AddString("One")
ListBox.AddString("Two")
Just copy and paste one (or both) of the ListBox.AddString("xxx") lines as many times as you want and replace "One" and "Two" with what you want.
It's also possible to modify the code the read in a vector of strings from the Mathcad worksheet, but that takes a little more effort and the above should do what you want.
RE: ListBox with multiple parameters
RE: ListBox with multiple parameters
If that's the case (and it makes sense upon a re-reading of the question) and the 14-parameter set is uniquely defined by the (one of < 256) concrete class, then there are several ways to skin the cat.
One way is to define the characteristics inside the listbox (script) as an array (or 14 separate arrays). The listbox index could then choose the appropriate set of parameters corresponding to the concrete class and return them as a vector. The listbox could be exported as a component, which would give the advantage of being updateable for every worksheet that used it.
Another way would be to just return concrete class index and, as the OP suggested, use that to index the parameter arrays in the worksheet. There are several ways to get the values into the worksheet without using up large amounts of visible worksheet in the process, eg:
a. Put all of the arrays in an Area and collapse it to hide the definitions. Has the advantage of encapsulating the parameters within the worksheet so that its provenance is readily established. The cloud in the silver lining is that, should the parameter values change, the values would need updating in each worksheet that had them ... not too bad for a couple of sheets but a right pain for many sheets and a possible configuration issue - although one way round this might be to use a scripting language (or even Mathcad) to change the values in the worksheet xmcd (xml) files (not sure if this can be done in Prime, though).
b. Put the values in a text/Excel file and read that in to the worksheet.
c. Define the values in a worksheet and directly link it using a Mathcad Reference (the 'parameter value' worksheet could also be used to create and update a data file.
RE: ListBox with multiple parameters
This is what i was doing until now, but the parameters never change.
As for option b), i'm currently experimenting with CSV files, and what i've learned is that i would need to define a csv for each class (not a problem), however excel or csv, i seem to have the same problem.
I can't figure out how to tell the dropdown when i select a class to return a row from that matrix/table/specific csv.After that i can manage. :)
Thank you all again for you're help.
Dan
RE: ListBox with multiple parameters
Your listbox should return an integer. In which case the easiest way in M14 to get a row from an array is to transpose it and use the column operator. Alternatively, use the submatrix function, eg if k is your index and the parameters are in array P, then submatrix(P,k,k,0,cols(P)-1) will return row k (assuming your using 0 as your array index base, drop the -1 if you're using base 1)
RE: ListBox with multiple parameters
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
[IMG http://tinyurl.com/7ofakss]
Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers
Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com: http://www.engineering.com/AskForum/aff/32.aspx
RE: ListBox with multiple parameters
I've managed to achieve my goal.
RE: ListBox with multiple parameters
Jim
RE: ListBox with multiple parameters
Basically , every column represents a class with it's coresponding parameters. This is enclosed in a region i hide.
Edited the script for the ListBox just so i can add as many classes as i need.Didn't even bother with the fact that it will start showing results from the second row, since matrix col/row numbering starts from 0 in mathcad.I added an empty row for that. Since it's hidden, it doesn't have to be pretty, it just has to work.
call out the selected column (ctrl+6) and that's it.
I literally just gave a written explanation on what he shown with that example.
This was the best solution for me at the moment.
Thanks again to both of you for you're help.
Dan