Google SketchUp is an easy-to-use 3D modelling application developed by Google that allows users to create, change and share 3D models. These 3D models are saved in the .SKP file format. This format has been gaining widespread adoption within the Engineering community. The SketchUp HIO component lets you import SketchUp files into HOOPS. To use this integration, you must download and install the Google SketchUp SDK.
To use the HOOPS/HIO component for SketchUp, please follow the steps below:
During start-up, when HOOPS/MVO finds the SketchUp HIO component in your application's path, it will perform the following steps:
Once the SketchUp HIO component is successfully loaded, your application will be able import SketchUp files without having to recompile HOOPS. To utilize the extensive services available in the SketchUp toolkit, you must compile against the SketchUp libraries directly and follow the steps described in 3.0 Integrating Directly with Google SketchUp.
The SketchUp HIO component was built against a specific version of SketchUp. If you want your application to run against another version of SketchUp, we recommend that you rebuild the SketchUp HIO component with that version of the library. To do so, simply open the hio_skp_vc<version>.vcproj project located in the <hoops>/Dev_Tools/hoops_hio/hio_skp/source. Be sure to set the environment variable SKP_SDK_INSTALL_DIR to point to the root of your SketchUp 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 SketchUp if interfaces are not compatible with the original libraries that the HIO component was built against.
HOOPS supports a variety of SketchUp entities. The following list names the supported entities.
Supported Entities:
Not Supported:
Within HOOPS/MVO, a variety of input options are available to facilitate the importing process. Specifically for SketchUp, you will find HInputHandlerOptions::m_bIgnoreOffLayer and HInputHandlerOptions::m_bIgnoreOffEntity available in HInputHandlerOptions. Both options let you determine if elements that are not visible should be imported into HOOPS. For instance, if the m_bIgnoreOffLayer option is set to true, HOOPS will not import any layers that are not set to visible in the SketchUp file. When the option HInputHandlerOptions::m_bIgnoreOffEntity is true, HOOPS does not import entities whose visibility is off. Note, the default for both options is false. Thus, HOOPS will import all layers and entities whether they are visible or not. The following sample code shows to set options for the HIOUtilitySKP input handler.
HInputHandlerOptions skp_input_options; // Set m_bIgnoreOffLayer to true so that HOOPS will not import of any layers (and its entities) whose visibility is off in the SketchUp file skp_input_options.m_bIgnoreOffLayer = true; //Set m_bIgnoreOffEntity to true so that HOOPS will not import of entities whose visibilty is off in the SketchUp file skp_input_options.m_bIgnoreOffEntity = true; skp_input_options.m_pHBaseView = view;. view->GetModel()->Read(FileName, view, true, &skp_input_options);
In addition to importing entities and layers, you can also import metatdata by setting the HInputHandlerOptions::m_bImportMetadata option to true.
If you want to use the full range of the SketchUp SDK services, the SketchUp HIO Component may not be suitable. Instead, you should integrate directly with SketchUp. First, please ensure that the Google SketchUp SDK is installed and in your application's path. To proceed with the integration, please follow these steps below:
Add files HIOUtilitySKP.h/.cpp and HSKPHelper.h/.cpp to your project. These files are located in the Dev_Tools/hoops_hio/hio_skp/source directory of your HOOPS installation. Refer hio_skp_vc80.vcproj in Dev_Tools/hoops_hio/hio_skp/source directory.
Once you have completed the above steps, you do not need to rely on the SketchUp 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 HIOUtilitySKP via HIOManager::RegisterInputHandler so that the HBaseModel::Read function can recognize that the .skp 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.
You should now be able to read SKP Files in your application with code similar to this:
HIOUtilitySKP skp_reader; HInputHandlerOptions skp_opt; skp_opt.m_pHBaseView = view; HFileInputResult result = skp_reader.FileInputByKey("c:\\temp\\myFile.skp", &skp_opt);
The SketchUp HIO component is supported on the Windows platform for the Visual Studio 2005 and 2008.
For Release 17, the SketchUp HIO component requires version 7 of the Google SketchUp SDK.