MKI_DWGDXF_IMPORT (Import and Export Classes) New in Version 2026.0

www.CAD6.com

C++ Syntax

class MKI_DWGDXF_DATA

{

  public:

 

  __int32 m_nImportContext,

          m_nCoordSysMode,

          m_nImportElementsMode,

          m_nTransmissionMode,

          m_nPreProcessingFormat,

          m_nImportMode,

          m_nOptions;

 

  double m_dGlobalScale,

         m_dFontScale,

         m_d3DEdgeAngleThreshold,

         m_d3DCornerAngleThreshold,

         m_d3DRadiusThreshold;

 

  MKI_FONTDEF m_cDefaultFont;

  MKI_STR2048W m_szCommandLine;

 

  MKI_DWGDXF_DATA( void );

 

  void

  Init( void );

 

  bool

  IsIdentical( const MKI_DWGDXF_IMPORT& f_rData ) const;

};

 

This structure contains information for a DWG / DXF import. Please refer to the help text of the corresponding CAD6 command for more details.

 

Element Description

m_nImportContext

[__int32] Defines the use-case for this structure. These use-cases may differ in available number and allowed combination of options, especially regarding layout mode and pages.

MKI_IMPORTCONTEXT_OPEN

Use-case "Open as new drawing".

MKI_IMPORTCONTEXT_IMPORT

Use-case "Import (merge) into the current drawing".

MKI_IMPORTCONTEXT_REFERENCE

Use-case "Load as referenced drawing".

m_nCoordSysMode

[__int32] Bit-wise OR combination of the following flags. Only applicable if m_nImportMode is IMPORTMODE_OPEN.

COORDSYS_DEFAULT

A possibly existing user coordinate system is ignored and the unit of the active coordinate system of the standard drawing template or the current drawing is used.

COORDSYS_APPLY_UCS

A possibly existing user coordinate system is transferred to the "_Auto-Model" coordinate system (recommended).

COORDSYS_KEEP_UNIT

The unit specified in the already existing coordinate system "_Auto-Model" is used.

m_nImportElementsMode

[__int32] Contains one of the following element (layers / line patterns) modes. Only applicable if m_nImportMode is IMPORTMODE_MERGE.

ELEMENTS_REPLACE

Delete all existing elements and replace them with the new ones.

ELEMENTS_COMBINE

Replace elements with equal names and add the others.

ELEMENTS_ADD

Add non-existing elements and leave the rest unchanged.

ELEMENTS_IGNORE

Don't import any elements. All imported objects will be assigned to the default layer / line pattern.

m_nTransmissionMode

[__int32] Contains one of the following transmission modes.

TRANSMIT_AUTOMATIC

The entity settings BYLAYER and BYBLOCK are automatically applied to the corresponding object properties (recommended).

TRANSMIT_LAYER_ONLY

When applying the entity settings BYLAYER and BYBLOCK to the corresponding object properties BYLAYER is preferred.

TRANSMIT_OBJECT_FIXED

The entity settings BYLAYER and BYBLOCK are ignored and the corresponding object properties are fixed or at least depend only indirectly on the layer or block instance.

m_nPreProcessingFormat

[__int32] Contains one of the following pre-processing modes.

CONVMODE_DEFAULT

The DWG / DXF drawing is imported so that it is displayed best possible (recommended). For that the pre-processing is carried out with default parameters.

CONVMODE_CMDLINE

The specified command line options are used for the import.

CONVMODE_SKIP

No pre-processing is performed (only possible with DXF files).

CONVMODE_MINIMUM_OBJ_NUM

DXF drawing is imported so that the number of objects generated is as low as possible. For that hatches are converted to transparent, colored areas.

m_nImportMode

[__int32] This setting is used to hide, enable, or disable corresponding controls in the corresponding dialog (such as MKI_DialogImportPdf).

IMPORTMODE_OPEN

These options refer to opening a complete drawing file with all objects in model space as well as all pages including their objects as a new drawing (such as File > Open Drawing).

IMPORTMODE_MERGE

These options refer to merging only model space objects into the current drawing (such as File > Import > XXX Drawing (*.xxx)).

IMPORTMODE_REFERENCE

These options refer to loading only model space objects as a drawing reference into the current drawing (such as File > External Reference > Insert).

m_nOptions

[__int32] Bit-wise OR combination of the following flags.

OPTION_MODELSPACEONLY

Import only model space objects. Objects in paper space layouts are ignored.

OPTION_COLORSWITCH

If set: White background and dark gray levels. If not set: Black background and bright gray levels.

OPTION_ENFORCEBRIGHTGRAYLEVELS

Enforce bright gray levels.

OPTION_ADAPTDRAWINGSETTINGS

Some drawing settings will be automatically changed (recommended).

OPTION_CONVERTPOLYLINE

All polylines of the DWG / DXF file will be automatically resolved into separate lines and circular arcs during import.

OPTION_IGNOREPOINTDISPLAYSETTINGS

Ignore the point display settings specified in the DWG / DXF file and use the marking display settings from the drawing template instead (command Manage > Drawing Settings > Screen).

OPTION_EMBEDBITMAPS

Embed referenced bitmaps into the drawing.

OPTION_IGNOREEMPTYBLOCKS

Ignore empty blocks.

OPTION_CONVERTMULTILINETEXTS

Convert multi-line texts into single-line texts for improved editability.

OPTION_IGNOREEMPTYTEXTS

Ignore empty texts.

OPTION_ALWAYSUSEDEFAULTFONT

Any font in the DWG / DXF file is replaced with the default font.

OPTION_IFNOFONTUSEDEFAULTFONT

Replace all fonts that are not available with the default font.

OPTION_NOWARNINGS

Do not display any warnings at all.

OPTION_SHOWPROTOCOLWINDOW

Display the protocol window after pre-processing.

OPTION_OPTIMIZELINETYPES

Use the optimized display mode for line patterns (command Manage > Drawing Settings > Screen).

OPTION_NOOBJECTSORTING

Do not reorganize the object order after import.

OPTION_REPLACEELEMENTSONOPEN

When opening a new drawing always replace layers and add line patterns (recommended). Only applicable if m_nImportMode is IMPORTMODE_OPEN.

OPTION_USECONFINEDMODEFORREFS

References use only their own elements.

OPTION_DELETEDIMTEXTBACKGROUND

Erase the background of dimension texts.

OPTION_IMPORT3DAS2DWIREFRAMEONLY

Convert all 3D surface models to 2D objects (lines, triangles, and quadrangles) using 3D planar top view.

OPTION_NO3DGROUPING

Don't group imported 3D surface models into a 3D part.

OPTION_DETECT3DEDGES

Try to 3D detect edges based on the given edge threshold angle m_d3DEdgeAngleThreshold.

OPTION_DETECT3DCORNERS

Try to detect 3D corner-points based on the given edge threshold angle m_d3DCornerAngleThreshold.

OPTION_ALIGN3DRADIUS

Try to equalize all 3D points that lie within the given threshold radius m_d3DRadiusThreshold to one coordinate set.

m_dGlobalScale

[double] Scaling factor which is used to scale all imported DXF objects.

m_dFontScale

[double] Horizontal scaling that is applied to all texts after import.

m_d3DEdgeAngleThreshold

[double] Contains 3D edge threshold. The lower the value, the more edges will be detected. The default value is 15°.

m_d3DCornerAngleThreshold

[double] Contains 3D corner threshold. The lower the value, the more corners will be detected. The default value is 40°.

m_d3DRadiusThreshold

[double] Contains 3D threshold radius. The larger the value, the more points will be equalized. The default value is 0.001.

m_cDefaultFont

[MKI_FONTDEF] Default font.

m_szCommandLine

[MKI_STR20248W] String containing the command line options used for the import (empty string if there are no command line options).

 

MKD Syntax

This structure is used in drawing references (see MKI_ENTITY_REF) and as options for the application's -c command line parameter.

 

ImportMode,CoordSysMode,ImportElementsMode,TransmissionMode,PreProcessingFormat,Options,

GlobalScale,FontScale,3DEdgeAngleThreshold,3DCornerAngleThreshold,3DRadiusThreshold,

DefaultFont,MKConvCmdLine

 

CAD6interface 2026.0 - Copyright 2026 Malz++Kassner® GmbH