I do not see anything in the API help file either. Guess you will have to run SQL query on database. The two tables are CardLists and CardListValues.
So far I've been able to do everything I needed to do using the API. Guess I'll have to put in an enhancemennt request. Thanks.
EPDM 2010 SP2
Yeah, I need to be able to extract a customer code from my customer list to populate the data card. The only why I have found to do this is to nest the variable for customer code within the pulldown box for customer name. But I was told this could be done using an API, so if you have come across anything that can make displaying the cust code when we choose customer name, please let me know.?
We are using PDMWE 2009, Sp 4.0.
What I'm looking for is a way to get the values in a list using the API instead of using a SQL query. If I understand what you want, the new Text with Alias type in EPDM 2011 may help you. See page 13 in the What's New guide for EPDM 2011.
EPDM 2010 SP2
Have not tried it, but one of the hooks you can add is EdmCmd_CardLstSrc. Here is an excerpt from the Programmer's guide:
A file or folder data card containing a list box or combo box is displayed. The add-in’s OnCmd method is given the opportunity to fill-in the rows in the list instead of using the list contents defined in the card editor.
This hook is introduced in SolidWorks Enterprise PDM 6.0.
ID of the card control.
ID of the file (zero for folder cards).
ID of the folder.
ID of the card.
Name of the active configuration.
Full path to the file.
The name of the control’s variable.
ID of the control’s variable.
Pointer to an IEdmStrLst5 interface with all configuration names.
Note: You will also receive a pointer to the IEdmEnumeratorVariable5 and IEdmCard5 interfaces via the EdmCmd::mpoExtra argument. The contents of the EdmCmd::mbsComment member is the return value from your OnCmd implementation. This variable should be set to a newline-delimited list of strings to be inserted into the list box or combo box. Leave this variable untouched to use the standard values from the card editor.
It can be done prior to 2011, but it is ugly and not flexible. You can use the imput formula to in effect create a big if statement The syntax of the imput formula is
The separator in the formula is a comma, so your Customer Name cannot have a comma in it. The values has to match, so typos can cause problems. If you add Customer Names to the list you will have to edit the formula at add them.