cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Combo-box input is a Vector

AG_9665364
2-Explorer

Combo-box input is a Vector

Hi All

Looking to create a calculation which uses a drop down box to select beam size. I would like mathcad to then automatically populate all the remaining characteristics of the beam into the appropriate variables. I have downloaded the AISC shapes database as an excel file so I am using the READEXCEL function to input the excel data to mathcad. A combo box seemed like a really good fit. I'm trying to input columns from my data matrix into the combo box but it doesn't seem to be working. Any ideas? A snapshot of the simple worksheet below. 

AG_9665364_0-1655474756735.png

 

10 REPLIES 10
Werner_E
25-Diamond I
(To:AG_9665364)

Can it be because you wrote "Depth" instead of "depth"? Variable names are case sensitive.

Thanks Werner_E. Great point. I updated the variable and unfortunately it still does not work. 

Werner_E
25-Diamond I
(To:AG_9665364)


@AG_9665364 wrote:

Thanks Werner_E. Great point. I updated the variable and unfortunately it still does not work. 


That is regrettable. Unfortunately, I only have Prime 6 installed and therefore cannot say anything about the Combo Box, I only noticed the different spelling.
What error message is displayed?

I am just poking in the dark: You may check the labeling of the variables. When ever they occur this should be the same. If necessary you may manually label all occurrences of "depth" to "variable" or all to "-" (meaning autodetect):

I am not sure but it may be that Prime chokes on the first header entry of the columns "depth" which is a string"d" and not a number? In that case you may try depth:=submatrix(depth, ORIGIN+1, last(depth), ORIGIN, ORIGIN) to get rid of it in front of the combo box.


It would certainly make it easier for helpers with newer Prime versions to find the error if you could upload the worksheet  - or even better, a streamlined, simplified demo worksheet (without the need for extra Excel files to read in) which also show the same error.

Hi,

I adopt a different strategy than the combo box to get values from a large table.

Capture.JPG

Cheers

Terry

Hi

Option 2

Capture.JPG

Cheers

Terry

Hi,

Option 3

It transpires you can have 2091 rows in the edit box.  This database has imperial and metric quantities depending on what column you take.

Capture.JPG

Cheers

Terry

Hi,

One last post for completeness.  Have added "-metric" to the columns that contain metric data.

The combo box can be copied into your files.

Capture.JPG

Cheers

Terry

Hi,

Would not be finished without an example of how to use the section data to advantage.

Capture.JPG

Cheers

Terry

What do you mean by "I did not type them all in but manipulated the Prime internal xml file by cutting and pasting them from the AISC database Excel file with some manipulations..."

 

Where you able to insert the vector Labels into the combo box? 

PG_10330554_0-1660926426061.png

 

Hi

"I did not type them all in but manipulated the Prime internal xml file by cutting and pasting them from the AISC database Excel file with some manipulations..."

This will be long winded but explanation is as follows.

 

Create a Prime file with one combo box

 

Capture.JPGCapture2.JPG

 

A prime file is a zip file archive “*.zip” with an extension “*.mcdx” instead.
Worksheet is an “worksheet.xml” file within this zip archive.
It is possible to manipluate this “worksheet.xml” file with a text editor.
In this way you can add rows to a combo box with a text editor.
The steel spreadsheet has 2092 entries to add to a combo box which is too much to add by hand as it would take hours and be prone to mistakes.

Steps are:


Make sure in file explorer you turn on file extensions so you can change them.
Go to View | Show | File name extensions and select it

 

Capture4.jpg


Make a copy of the worksheet so if process is mistaken you have original to try again

 

Capture5.JPG

 

Change the copies file extension to “zip”.

 

Capture6.JPG

 

Open the zip file (I use winrar for this but) windows will open a zip file.
Select the mathcad directory

 

Capture7.JPG

 

Select the worksheet.xml file and extract it to a folder so you can edit it

 

Capture8.JPG

 

You now have a copy of the file you can edit in any text editor

 

Capture9.JPG

 

If you edit the file you can see:
it details number of rows in the ComboBoxControl data
Details the ComboBoxRowNames
Details the matching ComboBoxValues data.

 

Capture3.JPG

 

In a html editor it shows the document tree with indents to make file easier to read but it is actually spaceless text file

 

Capture10.JPG

 

Excel can be used to create the ComboBoxRowNames and matching ComboBoxValues with the markup text before and after values

<ml:rowName>one</ml:rowName>
<ml:rowName>two</ml:rowName>
etc across three cells each

 

Capture11.JPG

 

The cells from excel can be cut and pasted into the text file worksheet.xml
New file worksheet.xml can be placed into the zip file in the mathcad directory
Changing extension back to mcdx from zip recreates the Mathcad file with all the combo box values added.

 

Cheers
Terry

Announcements

Top Tags