Shared Parameter Value by Guid

Hi there,

this has to be easy,
but im really struggeling to find the parameter value of a shared parameter via dynamo/python.

in c# i would do it like this: “window.get_Parameter(new Guid(“c54e24d6-cb57-4fa2-a246-f65bcc1c8b3d”)).AsValueString())” but i cant for the love of god make it work in dynamo.

is there a package solution?

here is it with all parameters of a element.

Can i just read the one specific value?

This is a python try based on LookupParameter:


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

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)

windows= UnwrapElement(IN[0])
zuordnung_list = []

for window in windows:
    zuordnung = window.LookupParameter("Zuordnung Haus").AsString()
    zuordnung_list.append(zuordnung)
   
TransactionManager.Instance.TransactionTaskDone()

OUT = zuordnung_list```
import sys
import clr
clr.AddReference('ProtoGeometry')
import System
from Autodesk.DesignScript.Geometry import *

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)

windows= UnwrapElement(IN[0])
zuordnung_list = []

for window in windows:
    zuordnung = window.get_Parameter(System.Guid(“c54e24d6-cb57-4fa2-a246-f65bcc1c8b3d”)).AsString()
    zuordnung_list.append(zuordnung)
   
TransactionManager.Instance.TransactionTaskDone()

OUT = zuordnung_list```

That should work

3 Likes

Thank You.

Tested and working.
It really was simple :smiley:
You dont want to guess how long i was trying to get this to work myself :sweat_smile:

Thank You again, this really helps!

1 Like