Get List of instance parameters without instances

Get List of instance parameters without instances

lvirone
Enthusiast Enthusiast
400 Views
2 Replies
Message 1 of 3

Get List of instance parameters without instances

lvirone
Enthusiast
Enthusiast

Hello,

 

My goal is to determine which elements use a specific parameter so I can safely delete this parameter. Is it possible to get the list of instance parameter with the ElementType, Family or something else without any instances?

 

Thanks

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

jeremy_tammik
Alumni
Alumni
Accepted solution

Not really. Sorry about that. One workaround is to create a temporary dummy instance in a temporary transaction, grab its parameters, and roll back the transaction.

  

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

lvirone
Enthusiast
Enthusiast

Hi @jeremy_tammik 

 

Thank you for your answer.

 

I've tried to create a dummy schedule of a specific category (Wall) and use "schedule.Definition.SchedulableField" to get all wall parameters. But instead I get all the possible fields for all category in Revit. The worst part is that anybody can use the code in RevitApiDocs to create something a user can't and it feels like corrupting the schedule : https://www.revitapidocs.com/2019/2e28946e-7264-977b-c868-996b4a839048.htm

 

In a test, I created a schedule of for Wall where a user can set 57 fields, but with the API I created 2099 fields! If there is a way to filter the fields the user can see then we can get all the parameters for a category, even instance parameters.

 

lvirone_1-1706688844518.png

 

I hope i've explained correctly this little workaround.

0 Likes