Getting sharedparameter GUID, how?

Hello,

i can call my Parameter, but how can i get his GUID?

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('System')
clr.AddReference("System.IO")
from System import *
from System.Reflection import *
from System.Collections.Generic import *
from System.IO import *
#Use elemIds = List[ElementId](ids) for ICollection(ElementId)

#Import the Revit Services
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Import the Revit Nodes
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

#Import the Revit API
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

element = UnwrapElement(IN[0])

look = element.LookupParameter('HauptmaterialitaetElement')

OUT = look

Try this (not at my desk so I can’t confirm):
paramGUID = look.GuidValue

2022-06-20_14h36_32
@jacob.small ,

i can`t catch it.

Can you confirm it’s a shared parameter? IsShared Property

@jacob.small ,

how do i do that, it is a boolean as answear?

element = UnwrapElement(IN[0])
look = element.LookupParameter('HauptmaterialitaetElement')
shared = look.IsShared
guid = look.GuidValue

Was the answer in this case true or false? If false you wouldn’t have a GUID as it isn’t a shared parameter.

When i call just this it is true! @jacob.small when i ad GuidValue … it is not callable


def GetParamGUID(param):
	if hasattr(param, "GuidValue"): return param.GuidValue.ToString()
	else: return None


element = UnwrapElement(IN[0])
look = element.LookupParameter('HauptmaterialitaetElement')
shared = look.IsShared
guid = GetParamGUID(look)

OUT = guid,shared

value is Null :confused:

2022-06-20_15h49_22

It works for my one… Something about your parameter perhaps?

@Mark.Ackerley

I need the sharedParameterGUID not the unique Revit ID!

Apologies, I’m a little confused… Isn’t that this? :slight_smile:

3 Likes

Thank you so just call it with GUID!

2 Likes