Schema.EraseSchemaAndAllEntities
Description:
Erases all Entities corresponding to this Schema from all open documents, and erases this Schema from memory.
Erases all Entities corresponding to this Schema from all open documents, and erases this Schema from memory.
Remarks:
The intent of this method is to let the user control the amount of memory consumed by Extensible Storage data. It may also be useful during development. Obviously, this method cannot erase the Schema from closed documents, so if a saved and closed document contains Entities of this Schema, it will reintroduce it into memory. Top-level Entities corresponding to this Schema are erased; subentities are replaced with invalid Entities. It may be tempting to use this method to replace subentities such that the GUID is the same, but the Schema definition is different. This will break schema uniqueness when a new Schema is already in memory, and the old one is in a newly opened file. Never assign the same GUID to different Schemas. This method will not erase schemas or entities in embedded families.
The intent of this method is to let the user control the amount of memory consumed by Extensible Storage data. It may also be useful during development. Obviously, this method cannot erase the Schema from closed documents, so if a saved and closed document contains Entities of this Schema, it will reintroduce it into memory. Top-level Entities corresponding to this Schema are erased; subentities are replaced with invalid Entities. It may be tempting to use this method to replace subentities such that the GUID is the same, but the Schema definition is different. This will break schema uniqueness when a new Schema is already in memory, and the old one is in a newly opened file. Never assign the same GUID to different Schemas. This method will not erase schemas or entities in embedded families.
[ObsoleteAttribute("This method is deprecated in Revit 2021 and may be removed in the future version of Revit. To erase the schema and all its entities in one document, call document.EraseSchemaAndAllEntities().")]
public static void EraseSchemaAndAllEntities(
Schema schema,
bool overrideWriteAccessWithUserPermission
)
-
schemaThe Schema to erase.
-
BooleanoverrideWriteAccessWithUserPermissionNormally, the usual write access controls apply to prevent deletion of Entities that you don't have write permissions for. However, the user may choose to override the controls. Set this flag to true only if the user gave explicit permission to destroy the Schema.
-
No write access to this Schema.
-
A non-optional argument was NULL