/// <summary> /// Setting up to call and then processing the results from ListExternalFileReferences2 /// requires many lines of code when directly calling the API. /// This helper method shortens the amount of code required and makes it more readable. /// </summary> /// <returns></returns> public static IEnumerable <ExternalReferenceInfo> ListExternalFileReferences(this IComponent2 comp) { object vModelPathName = null; object vComponentPathName = null; object vFeature = null; object vDataType = null; object vStatus = null; object vRefEntity = null; object vFeatCom = null; int configOption; string configName; comp.ListExternalFileReferences2(out vModelPathName, out vComponentPathName, out vFeature, out vDataType, out vStatus, out vRefEntity, out vFeatCom, out configOption, out configName); var modelPathNames = vModelPathName.CastArray <string>(); var componentPathNames = vComponentPathName.CastArray <string>(); var features = vFeature.CastArray <string>(); var dataTypes = vDataType.CastArray <string>(); var statuses = vStatus.CastArray <swExternalReferenceStatus_e>(); var refEntities = vRefEntity.CastArray <string>(); var featComs = vFeatCom.CastArray <string>(); for (int i = 0; i < modelPathNames.Count(); i++) { yield return(new ExternalReferenceInfo(modelPathNames[i], componentPathNames[i], features[i], dataTypes[i], statuses[i], refEntities[i], featComs[i], (swExternalFileReferencesConfig_e)configOption, configName)); } }