Deleting parameters from revit family with check for it's usage

Deleting parameters from revit family with check for it's usage

vlad_kolesnikov1
Explorer Explorer
380 Views
3 Replies
Message 1 of 4

Deleting parameters from revit family with check for it's usage

vlad_kolesnikov1
Explorer
Explorer

Hello! I would like to make a code that would allow to delete unwanted parameters (those, that are not used in dimensions/arrays/formulas). And I would like to know how does Revit check the parameter for being used in dimensions and arrays:

vladkolesnikov1999_0-1720156533060.png

 

0 Likes
Accepted solutions (1)
381 Views
3 Replies
Replies (3)
Message 2 of 4

MarryTookMyCoffe
Collaborator
Collaborator
Accepted solution

you may need to find every parameter that is read only and check if

 

GetAssociatedFamilyParameter

 

give you null, On this point I don't see better way to find this out.

I'm not sure if method

 

GetAssociatedGlobalParameter

 

work in family document
this unfortunately need some trial and error

 
-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes
Message 3 of 4

vlad_kolesnikov1
Explorer
Explorer

@MarryTookMyCoffe Thank you for reply! I already found that parameters have this property, which I use as one of checks:

AssociatedParameters.IsEmpty

But I still have some kind of trouble, because parameters that are responsible for materials are unreachable for me. I use this simple code:

var paramList = fm.GetParameters().Where(e => e.IsShared && e.StorageType != StorageType.ElementId).ToList();

 

0 Likes
Message 4 of 4

MarryTookMyCoffe
Collaborator
Collaborator

I thing Parameters for materials are StorageType ElementId, so ! make you lose them

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes