Feature [Revit]: Excel parameter updater support for shared type parameters #3500
+22
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description & motivation
I opened a thread in the community some days ago because I couldn't update some parameters in the Revit schedules using the Excel Connector. Here is the original post:
https://speckle.community/t/revit-excel-parameter-updater-graying-out-custom-parameters-in-excel/11613
The problem was that Revit considers shared parameters as ScheduleField.Instance instead of ScheduleField.ElementType. Therefore, if the parameter was a "Type Parameter" and was obtained from the element, it would always be considered as "ReadOnly."
The solution was to obtain the parameter from the "Type" rather than from the element. Because of this, I added some logic in the code to handle Shared Parameters.
Reference: https://www.revitapidocs.com/2024/9888db7d-00d0-4fd7-a1a9-cdd1fb5fce16.htm
Changes:
ConvertView.Schedule -> AddColumnMetadataToDataTable
Screenshots:
Using the sample Architecture Project add a shared type parameter to the planting category:
![image](https://private-user-images.githubusercontent.com/23631382/338706368-1c7be263-8f18-4966-ae58-969d30ff1399.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5NzM1ODcsIm5iZiI6MTcxOTk3MzI4NywicGF0aCI6Ii8yMzYzMTM4Mi8zMzg3MDYzNjgtMWM3YmUyNjMtOGYxOC00OTY2LWFlNTgtOTY5ZDMwZmYxMzk5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDAyMjEyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlNzdlNjc5Y2VlODQzMmFiZTMxZjdiNjFhYzdiMGExMTk3ZGY4NmZjMjM4YjQ0N2I4MDAyNTNiMDBmM2JhODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MEf5meVOoBbHvusz_IP13UilG5Jzd7c6-MvdSTegRvg)
Add the type and the shared parameters to the existing schedule and sort by type (not itemize every instance)
![image](https://private-user-images.githubusercontent.com/23631382/338707171-02b77c01-17e3-46db-bbf6-9070baf4abe3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5NzM1ODcsIm5iZiI6MTcxOTk3MzI4NywicGF0aCI6Ii8yMzYzMTM4Mi8zMzg3MDcxNzEtMDJiNzdjMDEtMTdlMy00NmRiLWJiZjYtOTA3MGJhZjRhYmUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDAyMjEyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczNzkxNDBhMTUwOGIxMDE1ZmYyOTlhYzc2MDdhY2I3OTJlNWUyZTYyZDY4ODNjMGMzZmRhNTllYmY1ZDU0OTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QJPn2umkDk4leQ5rOttuC4GpELEAgdwUcbyymSr61ls)
Then:
Checklist: