'DirectShape' object has no attribute 'Symbol' python

Hi All,

As part of a bigger code I am having this issue when I use “OST_GeneriModels” in the line below to filter elements of category by family name:
I am not having issues with any other category.

Any ideas?

Thanks

#Generic Models - Lift
GenericModel_Escalator = [x for x in FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_GenericModel).ToElements() if "GEN_Escalator" in x.Symbol.FamilyName]

image

Can you find this family in your project browser?

Hi @jacob.small,

I have tested with multiple family names (all of them Generic Models).

As soon as I use any other OST_Category, there is no problem…

I can provide you with more detailed info about the generic model families if you want.

Cheers,

Best to post an Rvt with an instance creating this issue and the DYN which reproduces the problem (minimize the code and the Rvt file by deleting all in necessary lines to reproduce the issue in Dynamo and all but one instance to recreate the issue on.

1 Like

Thanks @jacob.small, I found the issue.

Thanks anyways!

Cheers,

1 Like