DirectShapeLibrary
Description:
DirectShapeLibrary is used to store pre-created geometry for further referencing via the definition/instance mechanism. It is not persistent: the scope of a library object is usually a single data creation session.
DirectShapeLibrary is used to store pre-created geometry for further referencing via the definition/instance mechanism. It is not persistent: the scope of a library object is usually a single data creation session.
Remarks:
There are two ways to add a definition to the library. The first is to add the definition as an array of geometry objects. A DirectShape created as an instance of that definition will hold a copy of predefined geometry, transformed as requested. If the definition was added as a DirectShapeType, a DirectShape object created as an instance of that definition will reference the type. Its geometry would be an instance of type geometry.
There are two ways to add a definition to the library. The first is to add the definition as an array of geometry objects. A DirectShape created as an instance of that definition will hold a copy of predefined geometry, transformed as requested. If the definition was added as a DirectShapeType, a DirectShape object created as an instance of that definition will reference the type. Its geometry would be an instance of type geometry.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.DirectShapeLibrary
System.Object
Autodesk.Revit.DB.DirectShapeLibrary
public class DirectShapeLibrary : IDisposable
| Name | Return Type | Description |
|---|---|---|
| AddDefinition(String, GeometryObject) | None | Add a definition to be reused by instances. A definition is a single geometry object. |
| AddDefinition(String, IList<GeometryObject>) | None | Add a definition to be reused by instances. A definition is a collection of geometry objects. |
| AddDefinitionType(String, ElementId) | None | Add a definition to be reused by instances. Adding a definition type will change how the instances are created. When asked to create a definition, the library object will look for a corresponding type object. |
| Contains(String) | bool | A quick check whether a definition already exists in the library. Checks for stored geometry objects only. |
| ContainsType(String) | bool | A quick check whether a definition type already exists in the library. Checks for type objects only. |
| Dispose() | None | Releases all resources used by the |
| FindDefinition(String) | IList<GeometryObject> | Find a definition by id |
| FindDefinitionType(String) | ElementId | Find a DirectShapeType element by definition id. The element will be used for creating instances of that definition. |
| GetDirectShapeLibrary(Document) | DirectShapeLibrary | Get the currently active Library object |
| Reset() | None | Removes all definitions from library. This is useful when importing several self-contained data sets within one session. Once a data set is imported, keeping the definitions specific to that data set will slow down the searches. |
| Name | Return Type | Description |
|---|---|---|
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. |