How to get PDM list values for a variable in a file datacard?

I’m trying to get the possible values for a variable that is linked a PDM list. Here’s a visual from my data card to explain the situation.

Here’s a snippet on how to do this in C#. One observation is if the list is grabbing data from a SQL server, the code might be slow to execute.

        private static IEdmFolder5 ppoRetParentFolder;

        static void Main(string[] args)

            var vault = new EdmVault5Class();
            vault.LoginAuto("bluebyte", 0);
            var file = vault.GetFileFromPath(@"C:\SOLIDWORKS PDM\BLUEBYTESYSTEMS\Bluebyte\api\sandbox\testfiles\Control_Panel_&.SLDASM", out ppoRetParentFolder);

            var variableName = "MDL_EngAppvl";

            System.Console.WriteLine(string.Join(System.Environment.NewLine, GetListValuesOfVariable(file, variableName)));


        public static string[] GetListValuesOfVariable(IEdmFile5 file, string variableName)
            if (file == null)
                throw new ArgumentNullException("file");

            if (string.IsNullOrEmpty(variableName))
                throw new ArgumentNullException("variable cannot be empty.");

            var vault = file.Vault; 

            var extension = System.IO.Path.GetExtension(file.Name).Replace(".","");
            var aCard = (IEdmCard6)(file.GetNextFolder(file.GetFirstFolderPosition())).GetCard(extension);

            var controlPosition = aCard.GetFirstControlPosition();
            var l = new List<string>();
            while (controlPosition.IsNull == false)

                IEdmVariable5 variable = null; 
                var control = aCard.GetNextControl(controlPosition) as IEdmCardControl7;
                var variableID = control.VariableID;
                if (variableID != 0)
                 variable = vault.GetObject(EdmObjectType.EdmObject_Variable, control.VariableID) as IEdmVariable5;
                if (variable != null)
                    if (variable.Name.ToLower() == variableName.ToLower())
                            string[] variablesList = null;
                            control.GetControlVariableList(file.ID, out variablesList);
                            if (variablesList != null)


            return l.ToArray();