ForgeTypeId and GetDataType

ForgeTypeId and GetDataType

MrBrangoBIM
Participant Participant
540 Views
2 Replies
Message 1 of 3

ForgeTypeId and GetDataType

MrBrangoBIM
Participant
Participant

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))

 

 

0 Likes
541 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

It remains unclear to me what you are trying to achieve and what your code has to do with your question.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

mhannonQ65N2
Collaborator
Collaborator

The GetParameter method only takes a ForgeTypeId. The get_Parameter method, however, takes a BuiltInParameter, a Definition, or a GUID.

0 Likes