A ScheduleField
isn’t quite the same as a Parameter
. While it represents the information held by a given parameter across multiple elements, it doesn’t contain any of the properties of the parameter itself.
In that respect, a ScheduleField
doesn’t have a read-only property. Only the element parameter itself would be read-only or not and that would vary element to element. What’s your reason for wanting to know which elements are read-only? We might be able to help you solve the larger issue you’re facing.
I am trying to develop a script which export the schedule to excel and then import the excel to update the changes made in excel to schedule. So while exporting itself I wanted to ignore read only fields. Is there any way to identify the underlying parameter associated with a ScheduleField through Revit API?. Basically my final goal is a Revit add-in for the same. So it would be helpful if you can guide me in that direction.
I managed to find the element id associated with each row in schedule. If the field name and parameter name is same , I can find the parameter using the field name. Is that the direction I should go forward?
Seems like a lot of extra work when you could just modify everything in the Revit schedule itself. Either way, the parameter itself isn’t read-only. It depends on the element it’s assigned to. You could have a Width parameter that’s modifiable on one family but driven by another parameter (and therefore read-only) on another family.
If the goal is to modify parameters, then you should already know which parameters need to be changed and which don’t. Whether the parameter is read-only or not is sort of irrelevant. If Width needs to change but it’s read-only then you really need to change something else. You need to know those relationships ahead of time.
Also scheduling across links will break this.
Also also groups.
Also also also global parameters.
Also also also also… a lot of stuff.
Got it. The main purpose is to update some instance parameters using excel say we need to replace a particular word in sheet name for 200 sheets.Hope it will work.
Got it.Let me try to get the parameters using the field names and move forward accordingly.
alternatively, i think u can avoid messing with schedule related properties and focus on elements. essentially, u create a virtual schedule in memory and make changes to that. if the logic matches with the one applied to the real schedule, it will flex to the changes u make. like the ones in red circle, those are builtin parameters i believe, which requires a schedule that’s not empty so u can grab an element instance at least. but in fact, u can grab instances with a collector from the current document.
Excel isn’t necessary.
All Elements of Category
> Element.GetParameterValueByName
> String.Replace
> Element.SetParameterValue
Schedule field has a parameter ID property. I think it is better to find the parameter using this ID rather than using Schedule field name. Is it the right method to find the parameter and to check whether its read only. If we use Schedule field name to find the parameter there can be instances where we may have 2 different parameters with same name.
That’s the best method for identifying the parameter, yes, but it still doesn’t solve your problem. A parameter itself is not read-only. A parameter can be applied to multiple elements and each element determines how that parameter is used and whether it may be read-only or not.
Again, what does it matter if the parameter is read-only or not really? If you can’t modify the parameter then you won’t modify the parameter. Your goal is to update parameter information. You should know what parameter information you’re modifying. You wouldn’t get all parameters from all elements and make blanket changes. You would filter for the specific parameters that you need to modify in the same way that you would filter for the specific elements that need to be updated.
Agree.
Thanks very much for the reply. One last question. Getparameter method from element class accepts only built-in parameter ID. Is there any way to retrieve the parameter using parameter id if its a custom project parameter.
Get all parameters from an element and then compare the target parameter ID with all parameter IDs of the element can be used if no direct method is available.
That or just LookupParameter
to search by name and then check the Ids match.