Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[ExtensibleStorage] Setting entity corrupts Revit 2021.1 model and crashes Revit

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
JOfford_13
812 Views, 3 Replies

[ExtensibleStorage] Setting entity corrupts Revit 2021.1 model and crashes Revit

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.

Labels (3)
3 REPLIES 3
Message 2 of 4
RPTHOMAS108
in reply to: JOfford_13

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.

Message 3 of 4
JOfford_13
in reply to: RPTHOMAS108

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.

Message 4 of 4
cwaluga
in reply to: JOfford_13

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.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community