How can I access Custom Component Properties in SpaceClaim?
Nikos Kallitsis
Member, Employee Posts: 34
✭✭✭✭
in Structures
How can I access a user-defined property in Custom Component Properties?
Tagged:
0
Best Answer
-
You can access the Custom Properties using Template.CustomProperties . Here is an example:
comp = GetRootPart().Components[0] #Select 1st Component in Tree
propDict = comp.Template.CustomProperties #Dictionary where Keys are the Property Names
print(propDict.Keys) #Returns list of Property Names in string format
prop = propDict[propDict.Keys[0]] #Select 1st Property using Property Name
print(prop.Name) #Returns Property Name (same as selected Key)
print(prop.Value) #Returns Property Value0