DATAKIT API  V2025.4
RevitReader Class Referenceabstract
+ Inheritance diagram for RevitReader:

Public Types

enum  LevelOfDetail { LevelOfDetail::ReaderGuessed = 0, LevelOfDetail::Coarse = 1, LevelOfDetail::Medium = 2, LevelOfDetail::Detailed = 3 }
 
enum  VisualStyle { VisualStyle::ReaderGuessed = 0, VisualStyle::Shaded = 1, VisualStyle::Textures = 2, VisualStyle::Realistic = 3 }
 

Public Member Functions

virtual Dtk_ErrorStatus _ReadConnectedEntity (const Dtk_NodeConnectorPtr &inConnector, Dtk_tab< Dtk_EntityPtr > &outEntity)
 
virtual Dtk_ErrorStatus ActivateReader ()=0
 
virtual Dtk_ErrorStatus CreateDocument (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)=0
 
virtual Dtk_ErrorStatus CreateDocumentGraphical (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
virtual Dtk_ErrorStatus DesactivateReader ()=0
 
virtual Dtk_ErrorStatus EndComponent (Dtk_ComponentPtr &inComponent)=0
 
virtual Dtk_ErrorStatus EndPopulateComponentsTree ()=0
 
virtual Dtk_ErrorStatus GetAssociatedEntities (Dtk_Node &inNode, Dtk_tab< Dtk_NodeConnectorPtr > &outAssociatedEntities)
 
virtual Dtk_ErrorStatus GetConnectorsPointingToThisComponent (Dtk_Component &inCompo, Dtk_tab< Dtk_NodeConnectorPtr > &outConnectedEntities)
 
virtual Dtk_ErrorStatus GetFilePreview (const Dtk_string &inInputFile, Dtk_PreviewPtr &outPreview)
 
virtual Dtk_ErrorStatus GetFileVersion (const Dtk_string &inInputFile, Dtk_string &outVersion)=0
 
virtual Dtk_Int32 GetVersion ()=0
 
virtual Dtk_ErrorStatus PopulateComponentsTree (const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)=0
 
virtual Dtk_ErrorStatus PopulateComponentsTree (const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)=0
 
virtual Dtk_ErrorStatus ReadAdditionalInfos (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)=0
 
virtual Dtk_ErrorStatus ReadAdvancedFeature (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 
virtual Dtk_ErrorStatus ReadComponent (const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)=0
 
virtual Dtk_ErrorStatus ReadComponentGraphic (const Dtk_ComponentPtr &inComponent, Dtk_GraphicalDataPtr &outGraphicalData)
 
virtual Dtk_ErrorStatus ReadEntity (Dtk_Node &inNode, Dtk_EntityPtr &outEntity)=0
 
 SetAsDeprecated ("2025.4", "Metadata are now always retrieved.") static void SetConfigRevitReadMetadata(Dtk_bool)
 Use to able/disable reading of Revit properties. By default, properties reading is enabled. More...
 
 SetAsDeprecated ("2025.4", "Use SetConfigRevitVisualStyle( VisualStyle ) instead.") static void SetConfigRevitRealisticView(Dtk_bool)
 Use to render as in revit "Realistic" and "Texture" visual style for views (with textures). By default, texture reading is disabled (as in "Shaded" style). More...
 
 SetAsDeprecated ("2025.4", "Views are now always retrieved.") static void SetConfigRevitReadViews(Dtk_bool)
 Use to able/disable reading of Revit 3d views. By default, view reading is enabled. More...
 
virtual ~RevitReader ()=0
 

Static Public Member Functions

static Dtk_bool Enable ()
 
static void SetConfigLevelOfDetail (LevelOfDetail)
 Use to retrieve only geometry corresponding to a specific level of detail. By default, level of detail retrieved is the one set in default view ({3D}) or "Detailed" if no default view exists. More...
 
static void SetConfigReadLinkedModel (Dtk_bool)
 Use to enables reading of Revit Linked Models, which file should be located in the same folder as the main project. More...
 
static void SetConfigRevitOrderCompo (Dtk_Int32)
 Use to provide the same component organization as IFC or a flat one. By default, components are organized as in IFC. More...
 
static void SetConfigRevitVisualStyle (VisualStyle)
 Determine which Revit visual style to use for convertion. The visual style determines which material color to apply on objects with material. See Autodesk documentation on Revit Visual Styles for detailed information. More...
 

Protected Member Functions

void _Init ()
 
void _Reset ()
 
Dtk_ErrorStatus _WriteInventoryInLogFile (Dtk_ID inID, int inNum, int *inCount, char **inEntitiesName)
 

Protected Attributes

Dtk_string _InputFile
 
FILE * _InputFilePtr
 

Member Enumeration Documentation

◆ LevelOfDetail

Enumerator
ReaderGuessed 
Coarse 
Medium 
Detailed 

◆ VisualStyle

Enumerator
ReaderGuessed 
Shaded 
Textures 
Realistic 

Constructor & Destructor Documentation

◆ ~RevitReader()

virtual RevitReader::~RevitReader ( )
pure virtual

Member Function Documentation

◆ _Init()

void Dtk_Reader::_Init ( )
protectedinherited

◆ _ReadConnectedEntity()

virtual Dtk_ErrorStatus Dtk_Reader::_ReadConnectedEntity ( const Dtk_NodeConnectorPtr inConnector,
Dtk_tab< Dtk_EntityPtr > &  outEntity 
)
virtualinherited

Reimplemented in GltfReader.

◆ _Reset()

void Dtk_Reader::_Reset ( )
protectedinherited

◆ _WriteInventoryInLogFile()

Dtk_ErrorStatus Dtk_Reader::_WriteInventoryInLogFile ( Dtk_ID  inID,
int  inNum,
int *  inCount,
char **  inEntitiesName 
)
protectedinherited

◆ ActivateReader()

◆ CreateDocument()

◆ CreateDocumentGraphical()

virtual Dtk_ErrorStatus Dtk_Reader::CreateDocumentGraphical ( const Dtk_string inInputFile,
Dtk_MainDocPtr outDocument 
)
virtualinherited

Reimplemented in ProeReader, and GltfReader.

◆ DesactivateReader()

◆ Enable()

static Dtk_bool RevitReader::Enable ( )
static

◆ EndComponent()

◆ EndPopulateComponentsTree()

◆ GetAssociatedEntities()

virtual Dtk_ErrorStatus Dtk_Reader::GetAssociatedEntities ( Dtk_Node inNode,
Dtk_tab< Dtk_NodeConnectorPtr > &  outAssociatedEntities 
)
virtualinherited

◆ GetConnectorsPointingToThisComponent()

virtual Dtk_ErrorStatus Dtk_Reader::GetConnectorsPointingToThisComponent ( Dtk_Component inCompo,
Dtk_tab< Dtk_NodeConnectorPtr > &  outConnectedEntities 
)
virtualinherited

◆ GetFilePreview()

virtual Dtk_ErrorStatus Dtk_Reader::GetFilePreview ( const Dtk_string inInputFile,
Dtk_PreviewPtr outPreview 
)
virtualinherited

Reimplemented in SolidEdgeReader, ProeReader, and _3dmReader.

◆ GetFileVersion()

◆ GetVersion()

◆ PopulateComponentsTree() [1/2]

◆ PopulateComponentsTree() [2/2]

◆ ReadAdditionalInfos()

◆ ReadAdvancedFeature()

virtual Dtk_ErrorStatus Dtk_Reader::ReadAdvancedFeature ( Dtk_Node inNode,
Dtk_ObjectPtr outEntity 
)
virtualinherited

◆ ReadComponent()

◆ ReadComponentGraphic()

virtual Dtk_ErrorStatus Dtk_Reader::ReadComponentGraphic ( const Dtk_ComponentPtr inComponent,
Dtk_GraphicalDataPtr outGraphicalData 
)
virtualinherited

◆ ReadEntity()

◆ SetAsDeprecated() [1/3]

RevitReader::SetAsDeprecated ( "2025.4"  ,
"Metadata are now always retrieved."   
)

Use to able/disable reading of Revit properties. By default, properties reading is enabled.

Parameters
DTK_TRUEto read Revit properties or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.
Deprecated:
Metadata are now always retrieved..

◆ SetAsDeprecated() [2/3]

RevitReader::SetAsDeprecated ( "2025.4"  ,
"Use SetConfigRevitVisualStyle( VisualStyle ) instead."   
)

Use to render as in revit "Realistic" and "Texture" visual style for views (with textures). By default, texture reading is disabled (as in "Shaded" style).

Parameters
DTK_TRUEto render texture or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.
Remarks
Texture files are searched in current folder and default Autodesk installation folder
Deprecated:
Use SetConfigRevitVisualStyle( VisualStyle ) instead.

◆ SetAsDeprecated() [3/3]

RevitReader::SetAsDeprecated ( "2025.4"  ,
"Views are now always retrieved."   
)

Use to able/disable reading of Revit 3d views. By default, view reading is enabled.

Parameters
DTK_TRUEto read Revit views or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.
Deprecated:
Views are now always retrieved.

◆ SetConfigLevelOfDetail()

static void RevitReader::SetConfigLevelOfDetail ( LevelOfDetail  )
static

Use to retrieve only geometry corresponding to a specific level of detail. By default, level of detail retrieved is the one set in default view ({3D}) or "Detailed" if no default view exists.

Parameters
Thedesired level of detail to be retrieved for geometry.
Warning
If no geometry is assigned to the level of detail chosen, the Body/Mesh contained in the node converted will be empty.

◆ SetConfigReadLinkedModel()

static void RevitReader::SetConfigReadLinkedModel ( Dtk_bool  )
static

Use to enables reading of Revit Linked Models, which file should be located in the same folder as the main project.

Parameters
DTK_TRUEto enables the feature, DTK_FALSE to only process the main model.

◆ SetConfigRevitOrderCompo()

static void RevitReader::SetConfigRevitOrderCompo ( Dtk_Int32  )
static

Use to provide the same component organization as IFC or a flat one. By default, components are organized as in IFC.

Parameters
DTK_TRUEto organize component as IFC (by Building, Level and element Category) or DTK_FALSE for flat organization.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetConfigRevitVisualStyle()

static void RevitReader::SetConfigRevitVisualStyle ( VisualStyle  )
static

Determine which Revit visual style to use for convertion. The visual style determines which material color to apply on objects with material. See Autodesk documentation on Revit Visual Styles for detailed information.

Parameters
Thedesired visual style to use for convertion.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.
Remarks
VisualStyle::Realistic usage toggles the retrieving of texture information.
Texture files are searched in current folder and default Autodesk installation folder.

Field Documentation

◆ _InputFile

Dtk_string Dtk_Reader::_InputFile
protectedinherited

◆ _InputFilePtr

FILE* Dtk_Reader::_InputFilePtr
protectedinherited