/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "RxModule.h" #include "RxDictionary.h" #include "DynamicLinker.h" #include "OdPlatformSettings.h" class OdDbDatabase; ////////////////////////////////////////////////////////////////////////// //DD:EXPORT_ON /** \details This is an interface class for the SVG import. */ struct OdSvgImport : OdRxObject { /** \details Contains a list of the SVG import operation results that are handled by the . */ enum class ImportResult { /** The import process is successfully finished.*/ success, /**The import process failed.*/ fail, /** The import process failed because of an incorrect input SVG file.*/ bad_file, /** The import process failed because of an invalid block name passed.*/ bad_block, /** The import process failed because of an incorrect destination database object.*/ bad_database, /** The import process failed because of an error while saving the image file (the possible reason is an invalid directory for saving).*/ image_file_error, /** The import process failed because no objects were imported.*/ no_objects_imported }; /** \details Imports a SVG file's contents to a drawing database with specified properties. \returns A value of the enumeration that contains the result of the import process. \remarks To specify import properties, use the method to get access to the import properties dictionary object. */ virtual ImportResult import() = 0; /** \details Retrieves a dictionary object that contains the set of SVG import properties. \returns A smart pointer to the dictionary object that contains properties used for the import of a SVG file's content to a drawing database. \remarks The list of supported properties for the SVG import operation is represented in the table below.
| Property Name | Description |
|---|---|
| Database | A target database object (an instance of the OdDbDatabase class). The contents of the SVG file are imported to this database. |
| SvgPath | A full path to the imported SVG file. |
| BlockName | A name of the block where imported data will be stored (*ModelSpace by default). If the block with that name does not exist it will be created. |
| ImagePath | String parameter that determines the directory to copy the images when importing a SVG file. If not specified, then the images will remain where they are. By default, the value of the property is empty. |
| Palette | OdIntPtr that defines the current palette. Must point to an array of 256 COLORREF elements (or be 0). If the color of the object in SVG matches some palette element, color index will be used for the imported entity in DWG. By default, the value of the property is 0 and all the colors will be imported as RGB (OdCmEntityColor::kByColor). |
| LineWeightScale | Double value that defines how SVG ‘stroke-width’ attribute is converted to OdDb::LineWeight By default, the value of the property is 100.0 (as if SVG units were representing millimeters) |