I’m not sure I follow…
If you just want a particular shared parameter in a project:
params = FilteredElementCollector(doc).OfClass(SharedParameterElement).ToElements()
paramset = []
for p in params:
if p.Name == "Depth":
paramset.append(p)
print(paramset)
From there you can get the definition, ID, guid and other information.
But to get the data - you need to get the information from the object - such as the sheet.
And note that Revit doesn’t clean up shared parameters and you can have multiple shared parameters f the same name (my example above returns two in our template) all pointing to different things. Also, old deleted shared parameters aren’t really deleted - just kind of hidden.
If you want the parameters related to a sheet - you don’t have to loop all the sheets. One sheet will do. FilteredElementCollector(doc).OfClass(ViewSheet).FirstElement() is fast and gives you the first sheet it finds. From there just get Parameters, ParametersMap or GetOrderedParameters() depending on what you’re doing.
def getparam(doc)
sheet = FilteredElementCollector(doc).OfClass(ViewSheet).FirstElement()
params = sheet.GetOrderedParameters()
for param in params:
if param.Definition.Name == "Sheets Submittal Date 02":
return param
Note: The above gets the first parameter it finds with the name. So, if you have several of the same name on the same object class - you have to further check. (Does happen.) Same as the LookUpParameter.