Hi,
I'm attaching a small addin and project that has been upgraded from Revit 2019 to Revit 2021. The original Revit 2019 file was created without any template or addins so it should be bare bones. The attached file is just that file converted and saved in Revit 2021.1. The following actions cause the 2021 model to become corrupted and hard crashes Revit. Please advise.
1. Open the attached Revit project
2. Click the MyCommand button on the "Test" ribbon tab
3. Save and close the file
4. Re-open the file
For me Revit hard crashes at this point. When I try and open the file with the audit option selected it replaces all the curtain panels that were modified by the command, losing all the extensible data stored on those elements.
Solved! Go to Solution.
Hi,
I'm attaching a small addin and project that has been upgraded from Revit 2019 to Revit 2021. The original Revit 2019 file was created without any template or addins so it should be bare bones. The attached file is just that file converted and saved in Revit 2021.1. The following actions cause the 2021 model to become corrupted and hard crashes Revit. Please advise.
1. Open the attached Revit project
2. Click the MyCommand button on the "Test" ribbon tab
3. Save and close the file
4. Re-open the file
For me Revit hard crashes at this point. When I try and open the file with the audit option selected it replaces all the curtain panels that were modified by the command, losing all the extensible data stored on those elements.
Solved! Go to Solution.
Solved by RPTHOMAS108. Go to Solution.
These kinds of errors typically occur when the schema of a certain ID exists in the document but in your Addin the structure of the schema with the same ID has since changed. This would include aspects such as what you set for Documentation and probably the VendorID I'd imagine. You have to manage the lifecycle of schemas carefully. When you want to change the structure you have to create a new scheme with entirely new ID and transfer the old information over. Should it crash Revit, historically it has tended to.
The workflow is typically to look for a schema and only build one if the one you are looking for doesn't already exist in the document i.e. don't build a schema during OnStartup etc.
These kinds of errors typically occur when the schema of a certain ID exists in the document but in your Addin the structure of the schema with the same ID has since changed. This would include aspects such as what you set for Documentation and probably the VendorID I'd imagine. You have to manage the lifecycle of schemas carefully. When you want to change the structure you have to create a new scheme with entirely new ID and transfer the old information over. Should it crash Revit, historically it has tended to.
The workflow is typically to look for a schema and only build one if the one you are looking for doesn't already exist in the document i.e. don't build a schema during OnStartup etc.
Thanks for the info. After modifying the code to only build the schema if it doesn't already exist in memory seems to fix the issue. What's weird is that I've used the same schema since Revit 2016 and this is the first time that building it in the app start event caused Revit to crash.
I've confirmed that the schema did not exist in the original test file. The schema was first built in Revit 2021.1 when the app loaded for the first time.
Thanks for the info. After modifying the code to only build the schema if it doesn't already exist in memory seems to fix the issue. What's weird is that I've used the same schema since Revit 2016 and this is the first time that building it in the app start event caused Revit to crash.
I've confirmed that the schema did not exist in the original test file. The schema was first built in Revit 2021.1 when the app loaded for the first time.
Be careful. It can still happen that you create files with two different schema versions (fixing typos in doc strings suffices as mentioned above). This is a terrible source of hard-to-find problems and the cause is that Revit seems to cache existing schemas upon opening projects and keeps them for the entire session.
Be careful. It can still happen that you create files with two different schema versions (fixing typos in doc strings suffices as mentioned above). This is a terrible source of hard-to-find problems and the cause is that Revit seems to cache existing schemas upon opening projects and keeps them for the entire session.
Can't find what you're looking for? Ask the community or share your knowledge.