The Design Web Format (DWF) is a popular file format from Autodesk. It allows users to share design data without requiring a full seat of the design authoring application. Developers can now export this data from their HOOPS-based Application by using the DWF specific classes provided with your HOOPS/3dAF package and downloading the latest version of the DWF SDK from the Autodesk Developer Area.
To use the HOOPS/HIO component for DWF, please follow the steps below:
During start-up, when HOOPS/MVO finds the DWF HIO component in your application's path, it will perform the following steps:
Once the DWF HIO component is successfully loaded, your application will be able import DWF files without having to recompile HOOPS. To utilize the extensive services available in the DWF toolkit, you must compile against the DWF libraries directly and follow the steps described in 5.0 Integrating Directly with the DWF Classes. If you are interested in importing DWF files into your application, please contact a Tech Soft 3D representative for more information.
The DWF HIO component was built against a specific version of DWF. If you want your application to run against another version of DWF, we recommend that you rebuild the RealDWG HIO component with that version of the library. To do so, simply open the hio_dwf_vc<version>.vcproj project located in the <hoops>/Dev_Tools/hoops_hio/hio_dwf/source. Be sure to set the environment variable DWF_SDK_DIR to point to the root of your DWF installation before you begin building. Once the project is built against the correct libraries, an .hio file will be created. Note that you may face some obstacles building against a different version of the DWF if interfaces are not compatible with the original libraries that the HIO component was built against.
The following entities are supported for export to DWF:
The entities listed below are not available for export to DWF:
The HOOPS DWF exporter relies on a number of output settings. The most important one is whether to create a 2D or 3D DWF. You can specify which output you want to export by setting the HOutputHandlerOptions::m_b3dOutput flag and passing it to the HBaseModel::WriteWithOptions method. If the output is a 2D DWF, then the page size will be 8.5" by 11.0". If you want to output a 3D DWF, you will need to determine the camera settings as well.
When you are exporting 3D DWF, the camera which is defined at export time will be saved with the model. Since camera setting are found in HBaseView, you must supply a pointer to your HBaseView object via HOutputHandlerOptions::m_pHBaseView in your call to the HBaseModel::WriteWithOptions method.
To ensure that the pre-set camera available from the DWF Viewer works as expected, you will need to orient your data according to the DWF setup. Specifically, the DWF Viewer assumes a right-handed coordinate system, where the front view is defined as looking down the z-axis in the negative direction, with the Y-axis pointing up.
In HOOPS, you can identify a specific segement as a node to the DWF Viewer's model browerser by setting that a suer option of node on that segment. When it is laster selected in the model browser, that segment and all its children will be highlighted in the 3D window. Furthermore, if you set additional "name= value" pairs as a user options on that same segment, these will be displayed in the Properties window.
In this section, we outline the steps involved in directly integrating between your HOOPS-based application and the DWF classes. Once you have downloaded and installed the DWF Toolkit (version7.2 or greater), please follow the steps below:
Add HIOUtilityDwfExport.h and .cpp to your project. These files are located in the Dev_Tools/hoops_hio/hio_dwf/hoops_dwf/source directory of your HOOPS installation. Refer to hio_dwf<import/export>_vc80.vcproj in Dev_Tools/hoops_hio/hio_dwf/hoops_dwf/source directory.
Once you have completed the above steps, you do not need to rely on the DWF HIO component anymore. Please remove the associated .hio file from the hio_plugins directory in your application's working directory. Note that in a direct integration, you must register HIOUtilityDwfExport via HIOManager::RegisterOutputHandler so that the HBaseModel::Write function can recognize that the .dwf file format is supported. For more information on HOOPS/MVO file input/output architecture, please see section 4.0 File Input/Output and the I/O Manager of the HOOPS/MVO Programming Guide.
Once you have these settings you should now be able to export DWF files from your application with code similar to this:
HIOUtilityDwfExport exporter; HOutputHandlerOptions options; options.m_pHBaseView = m_pHView; options.m_b3dOutput = false; HFileOutputResult result = exporter.FileOutputByKey("c:\\temp\\myModel.dwf", m_pHView->GetModelKey(), &options);
Our integration is supported on the platforms supported by the DWF Toolkit for Microsoft Visual Studio 8 and 9.
For Release 18, the DWF HIO component requires DWF 7.6.