Hello,
I’m creating tool that will compute center of gravity of wood framed modular construction made mostly with Structural Framing elements as frame and Parts as sheathing. Unfortunately while testing it in different projects I have encountered weird issue.
When I’m trying to get area of part with"
cummulative_parts_area = 0
for item in parts:
item_host = str(item.LookupParameter("FM HostMemberSortMark").AsString())
part_layer = str(item.LookupParameter("Framing Member Mark").AsString())
if 'ssw' in item_host.lower():
removable_parts.append(item)
if part_layer.lower() == 'w1':
print(item.Id)
print(item.Category.Name)
part_area = item.get_Parameter(DB.BuiltInParameter.DPART_AREA_COMPUTED).AsDouble()
cummulative_parts_area += part_area
I receive AttributeError: ‘NoneType’ object has no attribute ‘AsDouble’. Even though RevitLookup and parameters are showing those values. Here’s the picture with this issue:
What is more interesting DB.BuiltInParameter.DPART_VOLUME_COMPUTED is accessed correctly.
Have you ever get simmilar issues? I’d appreciate your help.
Regenereating document didn’t work so for now I’ll just encapsulate with try: ... except ...
but I’d preferer more consistent solution.