Drawings SDK Developer Guide > Working with .dwg Files > Working with Other File Formats > Importing from Other Formats > Importing .dgn Files to .dwg Files > DGN Import Parameters
DGN Import Parameters

DGN Import Parameters

Name Type Values Default Value Details
DgnPath OdString OdString::kEmpty Specifies the path to the .dgn file to be imported.
Database OdDbDatabasePtr NULL Specifies the .dwg database in which to import the .dgn file. If it is not defined, DGN Import creates a new, empty .dwg database, imports the .dgn file into it, and returns it by that parameter.
Services OdDbHostAppServicesPtr NULL Specifies .dwg host app services for DGN Import.
DgnServices OdDgHostAppServicesPtr NULL Specifies .dgn host app services for DGN Import.
ImportActiveModelToModelSpace bool true If true, imports active .dgn model to .dwg model space, otherwise imports to .dwg model space first then .dgn design model from model table.
ImportPaperSpaceModels bool true If true, imports all .dgn sheet models to paper space layouts. Otherwise it imports one .dgn model to .dwg model space only.
XRefImportMode OdUInt8
  • 0 - Omit
  • 1 - Retain
  • 2 - MergeToCell
  • 3 - Create Dgn Underlay
2 Specifies .dgn reference attachment import mode: "Omit" - don't import .dgn reference attachments; "Retain" - convert attached .dgn files to .dwg and create .dwg Xref; "MergeToCell" - create block definition and import attached .dgn file to it, then create block reference to .dgn attachment block; "Create Dgn Underlay" - create dgn underlay object.

ExplodeTextNodes bool false If true, import text node as set of OdDbEntities (OdDbText, OdDbLine, etc.), otherwise convert .dgn text node to OdDbMText.
RecomputeDimensionsAfterImport bool false If true, re-compute all dimensions to create .dwg-based dimension geometry blocks, otherwise create .dgn-based dimension geometry blocks.
MS_SYMBRSRC OdStringArray OdString::kEmpty Paths to .dgn resource (*.rsc) files (fonts, line styles, etc.).
DontImportInvisibleElements bool false If true, skip all invisible .dgn elements, otherwise import them to .dwg as invisible objects.
ImportViewIndex OdUInt8
  • -1
  •  0
  • -7
-1 Specifies number of .dgn views to use level masks and .dgn view settings. If view number is "-1", view is not defined and view settings and level masks are not used.
3dEllipseImportMode OdUInt8
  • 0 - OdDbEllipse
  • 1 - OdDbRegion
0 Specifies how to convert OdDgEllipse3d elements.
2dEllipseImportMode OdUInt8
  • 0 - OdDbEllipse
  • 1 - OdDbRegion
0 Specifies how to convert OdDgEllipse2d elements.
3dShapeImportMode OdUInt8
  • 0 - OdDbPolyline
  • 1 - OdDbRegion
  • 2 - OdDbPolyfaceMesh
1 Specifies how to convert OdDgShape3d and 3d OdDgComplexShape elements. If an element is filled, OdDbHatch is created as well as the result of importing.
2dShapeImportMode OdUInt8
  • 0 - OdDbPolyline
  • 1 - OdDbRegion
  • 2 - OdDbPolyfaceMesh
0 Specifies how to convert OdDgShape2d and 2d OdDgComplexShape elements. If an element is filled, OdDbHatch is created as well as the result of importing.
3dClosedBSplineCurveImportMode OdUInt8
  • 0 - OdDbSplinePtr
  • 1 - OdDbRegion
1 Specifies how to convert closed OdDgBSplineCurve3d elements.
2dClosedBSplineCurveImportMode OdUInt8
  • 0 - OdDbSplinePtr
  • 1 - OdDbRegion
0 Specifies how to convert closed OdDgBSplineCurve2d elements.
shxFontsPath OdString OdString::kEmpty Specifies the path to put .shx font files after conversion of .rsc fonts.
LineWeightMap OdDgnImportLineWeightsMapPtr

A lineweight map stores pairs of corresponding .dgn and .dwg lineweight values, allowing for conversion of lineweights from .dgn format to .dwg format.

To set a lineweight map, get a pointer to the OdDgnImportLineWeightsMap object first.

To get access to the lineweight map object, use the get_LineWeightsMap() method of the import properties object. To get import properties, call the properties() method of the importer.

It is possible to handle lineweight values using the following methods:

  • setLineWeightForDgnIndex() to set a lineweight for an appropriate .dgn index.
  • copyLineWeightsMap() to copy a lineweight map object.
  • getLineWeightByDgnIndex() to get the current lineweight value for an appropriate .dgn index.
  • resetToDefaults() to set all lineweights to default values.
ConvertDgnColorIndicesToTrueColors bool false If the property value is true, DGN Import always converts .dgn color indexes to RGB true colors. If the property value is false (default), DGN Import tries to convert .dgn color indexes to dwg color indexes (gets color from .dgn color table and tries to find the same color in .dwg color table), and if it is not possible it saves the color as an RGB true color to the .dwg file.
ConvertEmptyDataFieldsToSpaces bool true

If true (by default), empty field values from a .dgn file are replaced with space symbols in the .dwg file.

If false, empty field values from a .dgn file are replaced with underscore symbols ("_") in the .dwg file.

See Also

DGN Elements Available for Import to .dwg Files

Importing .dgn Files to .dwg Files

Working with Other File Formats

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.