public static DefinitionFile GetSharedParamFile(Autodesk.Revit.ApplicationServices.Application app, string sharedParamsFilePath)
        {
            string sharedParamsFileName;
            sharedParamsFileName = app.SharedParametersFilename;

            if (sharedParamsFileName.Length > 0)
            {
                return app.OpenSharedParameterFile();
            }
            else
            {
                string path = sharedParamsFilePath;
                StreamWriter stream;
                stream = new StreamWriter(path);
                stream.Close();

                app.SharedParametersFilename = path;
                sharedParamsFileName = app.SharedParametersFilename;

                return app.OpenSharedParameterFile();
            }
        }
        public static Guid SharedParamGUID(Autodesk.Revit.ApplicationServices.Application app, string defGroup, string defName)
        {
            Guid guid = Guid.Empty;
            try
            {
                DefinitionFile file = app.OpenSharedParameterFile();
                DefinitionGroup group = file.Groups.get_Item(defGroup);
                Definition definition = group.Definitions.get_Item(defName);
                ExternalDefinition externalDefinition = definition as ExternalDefinition;
                guid = externalDefinition.GUID;
            }
            catch (Exception)
            {

            }
            return guid;
        }