Getting the GUID from a SharedParameterElement

I’m attempting to generate a list of GUID’s from input SharedParameterElements. The snoop tool illustrates what I am going after.

Here is my current node layout to help illustrate the process I’m going through currently…

The python node is where things are getting hung up. I’ve done some research and tried to reverse engineer elements that I’ve gotten from other python scripts, but am having some issues, admittedly I don’t know enough about python scripting to know what I’m doing wrong. Below is a snapshot of the code I’m attempting to use. Any and all help/guidance/suggestions is appreciated. Thanks!

Hello Garret!

I recomend that you read this page: https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#revitapi , especially the section about Unwrapping. All dynamo elements needs to be unwrapped before you can do revit API actions to them. It would also help if you attached the error message from the python node.

EDIT: I’m sorry, I was thinking about Uniqe ID. Good that Kulkul is still awake.

Hi Garret,

And also have a look at the bakery package. It has got nodes for GUIDS.

Outstanding, thank you both for all the great information! I’ve seen the nodes and what not that can pull the shared parameter guids from elements. My ultimate goal is to be able to pull the guid from the shared parameter element itself rather than via another element. I’m not sure if that is possible though. It seems like Revit only stores the guid information for a shared parameter within a “hosting” element, and not within the shared parameter element itself. I may be way off there though so again, any thoughts are much appreciated!

Thank you both again for taking the time to respond and share your knowledge!

Hi, were you able to get GUID of shared parameter elements?

Edit: Using Python?

Thanks, Simon

Here is a short script which gets the Guids for all shared parameter elements in the current document:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import FilteredElementCollector, SharedParameterElement

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
spe = FilteredElementCollector(doc).OfClass(SharedParameterElement)
OUT = [s.GuidValue for s in spe]
3 Likes

It’s possible to get, furthermore, the name of those sharedparameters which it’s able to get the guid?

Hi Fernando,

You might find this node useful :

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import FilteredElementCollector, SharedParameterElement

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
spe = FilteredElementCollector(doc).OfClass(SharedParameterElement)

guid = []
pName = []

for s in spe:
	guid.append(s.GuidValue)
	pName.append(s.Name)

OUT = pName, guid
3 Likes