Only selectable values for a given variable (pick from list)
Only selectable values for a given variable (pick from list)
(OP)
Hi folks!
I was wondering if its possible in Mathcad to eg. define a value for concrete compressive strenght fck, but instead of manualy entering values (like 20MPa,25MPa,30MPs...) I would only choose values from a some sort of list that pups-up when clicking in the "fck"=... value box.
Another thing, when you select a value of fck=30MPa is there any chance that MATHCAD automaticly uses value of modulus of elesticity coresponding to fck=30MPa.... Emodulus=30.000MPa?
Egsample, when you select a value for fck, a coresponding value for E would be automaticly choosen for later calculations...
fck=20MPa ---> E=25.000MPa
fck=25MPa ---> E=29.000MPa
fck=30MPa ---> E=31.000MPa
Thank you.
I was wondering if its possible in Mathcad to eg. define a value for concrete compressive strenght fck, but instead of manualy entering values (like 20MPa,25MPa,30MPs...) I would only choose values from a some sort of list that pups-up when clicking in the "fck"=... value box.
Another thing, when you select a value of fck=30MPa is there any chance that MATHCAD automaticly uses value of modulus of elesticity coresponding to fck=30MPa.... Emodulus=30.000MPa?
Egsample, when you select a value for fck, a coresponding value for E would be automaticly choosen for later calculations...
fck=20MPa ---> E=25.000MPa
fck=25MPa ---> E=29.000MPa
fck=30MPa ---> E=31.000MPa
Thank you.





RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
Is that fck "list box" collapsable or youll always see the whole list of available values?
How did you create it?
Can you explain a bit that small programing pice of how to choose E values for selected fck value.
Thanx a lot!
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
can you place an egsample...you mean to use a formula for calculating E based on fck value?
I did that but I want to use code specific values for E
@occupant
Thank you, will try and report back
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
Concerning you question about all values being visible: Unfortunately there is no dropdown menu like component in Mathcad, at least not out of the box. The best we can use for this purpose are listboxes. But you can size those boxes so that only a limited number of entries are shown at once and you may scroll to get the rest, but the box will not expand dynamically when you click on it like a dropdown would do. To resize the component (I chose to see three entries out of the five or six I typed) you should first right click and chose "Show Arguments".
BTW, it may be a good idea to state which version of Mathcad you use when asking a question like this. If you would use Prime, the answer would have been much easier: No, you can't do that as we have no components in Prime.
@Occupant: I am not sure but is there any specific reason for posting pdf's rather than the real files? I guess a pdf is much less useful and if someone asks about Mathcad he sure is able to open a Mathcad document.
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
RE: Only selectable values for a given variable (pick from list)
Anyway I tried to use what you have presented in .pdf files but I cant simulate even the most simpliest egsample.
In the file attched i made a listbox were I defined values for fck.
I can select the value from the list.
When I type fck anywhere in the sheet I get an value that reperesnts the row number and not the value thats defined in the list box ?!
How to change this?
Linking E value to this fck list box value now seems like science fiction to me
Can oyu explain how to do this and attach some egsample please.
RE: Only selectable values for a given variable (pick from list)
Did you look at the sheet I posted? Its not a pdf and it looks to me that it does what you want and you can define the values you want to be displayed for choice as a normal Mathcad vector and do not need to edit the script to change values.
RE: Only selectable values for a given variable (pick from list)
Dont get me wrong but I hate to copy something without any knowledge of how the thing works
If you where maybe kind enough to explain command you used it would be great couse I dont understand any of them :_(
RE: Only selectable values for a given variable (pick from list)
What do you think?
rmix22 how did you add that scroll bar on the right side?
Only problem now is that I dont know how to increase the font of that "select box"
RE: Only selectable values for a given variable (pick from list)
Then I create a vector of strings consisting of the values of fck_list (numbers only, therefore divide by MPa) and added the string "MPa".
This string "name_list" is passed to the component as input, the output of the component is the index "sel" of the string which was selected. Depending on the value of "sel" f.ck and E are chosen from their appropriate vectors.
The component itself contains just a few VBS commands you may look at by right clicking the component and select "edit script".
I have put the creation creation of name_list and the assignments of f.ck and E in collapsed regions to put them out of the way.
For more information about VBS you may look up the appropriate help pages at the Microsoft site or all a lot of other ressources in the net. You have to keep in mind, though, that VBS (Visual Basic Script) is similar in some respects but not the same as pure VB or VBA (Visual Basic for Applications, the script languange in Excel, Word, ...).
RE: Only selectable values for a given variable (pick from list)
Can you tell me plase how dod you mae that scroll bar in the control box?
RE: Only selectable values for a given variable (pick from list)
In my opinion its much harder to maintain a sheet if the items are hard coded in the VBScript. Thats the reason I prefer to pass it to the component as normal Mathcad vector. Code is much easier and transparent to manage that way an the component is reusable without any change (other than the names of the input and output variable). Furthermore its much easier to pick the value from a vector using the returned index as vector index (minus 1, if ORIGIN is 0) than to write the series of if statements.