Draft: Resolve "Correction on getResultIDForParamCombination"
Closes #37
While working on solving this issue, I have realized why the foor loop was implemented like that in a first instance. The method getValuesForGivenResultID which is called inside the loop to retrieve the values of the project parameters for a certain ResultID makes use of the GetParameterCombination method of the CST COM interface. However, as stated by the CST documentation, this method does not work for a runID of 0:
GetParameterCombination( string resultID, variant parameterNames, variant parameterValues ) bool
Fills the variant 'parameterValues' with an array of double values that correspond to the parameter combination 'resultID' . The variant 'parameterNames' is filled with an array containing the parameter names. In case the parameter combination does not exist, the variants will not be modified and the method returns false. The string 'resultID' corresponds to an existing nonzero Run ID and is of the format "Schematic:RunID:1." Existing Result IDs can be queried using the command GetResultIDsFromTreeItem of the ResultTree Object. The method returns an error for Result IDs of invalid format. Note that this command cannot be used to resolve Run ID 0: Current Run.
A solution for this will be to detect, prior to the for loop of the getResulIDForParamCombination, if the 3D:RunID:0 is present in the resultIDsList. If this is the case, the loop can be directly skipped, since it can be guaranteed that the RunID 0 contains the results for the current parameter combination. It should be noted that CST deletes the results for runID 0 when a parameter changed of the project is performed. Therefore, if the results weren't present, the 3D:RunID:0 won't be present in the resultIDsList.
In addition, the getValuesForGivenResultID method of the Parameter class should be modified to only accept resultIDs with a runID greater than 0.