Message 1 of 3
ForgeTypeId and GetDataType
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello forum members.
I have a problem, don't understand ForgeTypeId and GetDataType.
Don't know why I find this complicated, but need your help.
Have read the Revit API but don't understand, maybe I'm making it more difficult than it needs to be.
Are there different approaches depending on whether it is a built-in parameter, shared parameter, categories or elements.
Could someone share a code that works so I can look and compare.
Thanks in advance!
I've tried with everthing I try ends up as an error:
TypeError: expected ForgeTypeId, got BuiltInParameter
def find_parameter(element):
for parameter in element.Parameters:
if parameter.Definition.GetDataType() == SpecTypeId.String.Text:
return parameter
wallId = ElementId(606536)
wall = doc.GetElement(wallId)
#inter = InternalDefinition
# forge = ForgeTypeId().TypeId
# Forge = inter
wall_comments = wall.GetParameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).Definition.GetDataType() == SpecTypeId.String.Text
print('____________Parameters_____________')
print(wall_comments)
#for p in wall.Parameters:
# print('.Name: {}'.format(wall_comments.Definition.Name))
# print('.StorageType: {}'.format(wall_comments.StorageType))
# print('.BuiltInParameter: {}'.format(wall_comments.Definition.BuiltInParameter))