Typecasting in Python

Hello!

I am working on a new script, where I am trying to change/add type names of a family, and I am collecting Family types as “Autodesk.Revit.DB.FamilySymbol”.
How can i typecast from “Autodesk.Revit.DB.FamilySymbol” to “Autodesk.Revit.DB.ElementType” in python?

image

image

I believe that will solve my issue of not being able to get/set elementtype.Name when I am working with a “Autodesk.Revit.DB.FamilySymbol”.
Is this correct?

Regards
A

Solved using doc.FamilyManager.RenameCurrentType( instead. Was not familiar with this Class. Thanks to @jostein_olsen :slight_smile:

1 Like