.dwg support

  1. FAQ
  2. »
  3. Products Overview
  4. »
  5. .dwg support

Is it possible to test Drawings Qt examples on non-Windows platform?

Qt examples build from archives are supported on Windows only at this moment.
You'll need to get full source code access via git in order to build them (for this you need founding or corporation membership).
If you just want to inspect Qt examples code, download corresponding DrawingsQt archive (note it targtes Windows),
and take Qt folder from there. However, there are no configurations to build it under Linux.
The reason for no having build confgiurations for Linux is there is no standart Linux setup for Qt, it is usually built locally or for specific distributive.

How do I determine the drawing units (millimeters, inches, feet, or kilometers) of a drawing?

Please find the article in our wiki. INSUNITS variable stores drawing units starting with AutoCAD 2000. Some vertical applications like Land Desktop Development store units in another way - in dictionaries probably because INSUNITS was not introduced yet by the moment. DWGUNITS command still exists for backward compatibility and note that it has an option to synchronize INSUNITS.

How to import polygonal mesh entities from DWG?

See OdDbPolygonMesh class. You can get MxN array of vertices.

See OdReadEx sample for details.

How to get polyface mesh entities from DWG?

See OdDbPolyfaceMesh class. You can get a set of vertices and faces.

How to import the mesh data from 3D DWG?

You can use oddbGetObjectMesh from DbSubDMesh.h. Alternative way is decomposeForSave (see CDwgView::OnEditAcisConversion from OdaMfcApp example application).

How does DWG comparison function work?

'COMPARE' command essentially inserts other drawing as an xref in the model space, then walks through the entities in the model and xref comparing them one by one. Resulting differences are grouped by extents and a polyline ("revision cloud") is generated around them (in the host model). 

How to change a code page (character encoding) of a .dwg file before importing it?

/** \details

Sets the DWGCODEPAGE value in the specified OdDbDatabase instance.

\param db [in] Database.
\param val [in] Value for DWGCODEPAGE.


This function provides write access to "Read-Only" system variables. It may be used to bypass non-implemented Drawings functionality or to repair drawings.

OdDbDatabase& db,
OdCodePageId val);

What is the correct behaviour for a block reference with its linetype set to ByBlock?

Block Reference is like any other entity: if it has ByBlock properties, than values from another stack level are used in case of nested blocks.

How to add tag attribute?

See Drawings/Examples/OdWriteEx/DbFiller.cpp Search for OdDbAttributeDefinition.

Is there any dimension feature available in ODA for DWG files?

Please find OdDbDimension class and classes derived from it in our documentation. https://docs.opendesign.com/td/db_dimensions.html

How to exclude custom OdDbEntity from selection?

You can use selection filter in OdDbSelectionSet query to exclude unnecessary entities from result selection set:


/** \details
    Filter selection only.  

    \param vpId [in]  id of OdDbViewportTableRecord  record or OdDbViewport entity in which to select.
    \param nPoints [in]  Number of points into selection shape.
    \param wcsPts [in]  Selection shape as set of World Coordinate Space points.
    \param mode [in]  Selection mode.
    \param sm [in]  Subentities selection mode.
    \param pFilter [in] object of type OdDbSelectionFilter or pointer to a OdResBuf chain defining the filter.
  static OdDbSelectionSetPtr select(
    const OdDbObjectId& vpId,
    int nPoints,
    const OdGePoint3d* wcsPts,
    OdDbVisualSelection::Mode mode = OdDbVisualSelection::kCrossing,
    OdUInt32 sm = OdDbVisualSelection::kDisableSubents,
    const OdRxObject* pFilter = 0);

I tried to open the DWG in AutoCad 2020. A message showed up warning 'It made by unauthorized application'.

This message indicates that the file was created with a non-Autodesk(c) software. As we are independent from Autodesk(c) this message must appear (with both regular and trial archives) as otherwise it will be a violation of the legal terms.

It it possible to select an entity within a block or a sub block (block within a block)?

Yes, it is possible, but for this action you need to set specific option in the device called blocks cache.

How to explode a .dwg file, so we could select an individual entity?

Model Space of the drawing contains single entity - Block Reference. Use explode() or explodeGeometry() fo it. See ODA Documentation for details.


Where can I find the list of prohibited characters?

Please see the Developer's Guide.

Note that ODA login required.

Does Drawings SDK provide a component that can be embedded into existing applications (specifically C# WPF)?

Our SDK is written in cross-platform C++. But we have .NET wrappers that can be used for a C# application. We also have a set of C# examples including one for WPF.