<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Lato;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;}
span.E-MailFormatvorlage24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I gave up to import DWG directly. I always convert them with ODA File Converter 20.8.0 to 2018 ASCII DXF, which I then import using QGIS DWG/DXF import feature. Only problem ism that
 large DXF i.e. including ALKIS Layers take ages for the import. In this case I drag&drop the DXF into qgis and filter the required Layers manually. In this case unfortunately the symbology is gone. All DWG are customer provided, I have no ACAD available.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Wolfgang
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Von:</b> Qgis-user <qgis-user-bounces@lists.osgeo.org> <b>
Im Auftrag von </b>Nicolas Cadieux<br>
<b>Gesendet:</b> Montag, 22. November 2021 18:55<br>
<b>An:</b> Jeff Sonnentag <jsonnentag@llenviroinc.com>; Bernd Vogelgesang <bernd.vogelgesang@gmx.de>; Greg Troxel <gdt@lexort.com>; Boaz Bar Ilan <boazprosie@gmail.com><br>
<b>Cc:</b> qgis-user <qgis-user@lists.osgeo.org><br>
<b>Betreff:</b> Re: [Qgis-user] Does DWG work in 3.22? - RE: importing dwg/dxf<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi,<o:p></o:p></p>
<p>The GDAL/ORG library works with <span style="font-family:"Lato",sans-serif">Open Design Alliance Teigha library. They have a support for R13-15, R2004, R2007, R2010, R2013 and R2018 but since Autocad is a closed format, then all of this is basically the
 result of  reversed engineering.  DXF is an open format so that is easier to deal with.</span><o:p></o:p></p>
<p><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040;background:#FCFCFC">I believe that the drag and drop functions for DWG and DXF uses the libopencad drivers (and that is limited to r2000 or ACAD1015)) (at least in QGIS 3.20) so if
 you did drag and drop a correct file format, then the DWG worked.<br>
<br>
</span><o:p></o:p></p>
<p><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040;background:#FCFCFC">It's my personal experience that anything past R15 (2000) will be buggy in QGIS but you can also open those files using the project > import/export > import layer
 from DWG/DXF. For some reasons, some DWG files cannot be dragged and dropped but can be imported via the project import function. This has the advantage of keeping the Autocad styling. I guess this function probably uses the
</span><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040">Open Design Alliance Teigha library and not the libopencad drivers as it will open files that I cannot drag and drop???  Looks like those functions are not available via the python
 API nor the Processing toolbox either:(<br>
<br>
</span><o:p></o:p></p>
<p><span style="font-size:12.0pt;font-family:"Lato",sans-serif;color:#404040;background:#FCFCFC">Anyways, when that fails (about 50% of the time on very big files), I save the DWG to DXF and that either fixes the file or makes it more compatible with the driver. 
 IMHO, Exporting dwg to shp file is the only real interesting feature of AutoCAD Map3D.  The last version I regularily worked with has probably 2013-15 so maybe they have updated the product since.<br>
<br>
</span><o:p></o:p></p>
<p><a href="https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/AutoCAD-drawing-file-format.html">https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/AutoCAD-drawing-file-format.html</a><o:p></o:p></p>
<p><a href="https://docs.qgis.org/3.22/en/docs/user_manual/managing_data_source/opening_data.html?highlight=dwg#importing-a-dxf-or-dwg-file">https://docs.qgis.org/3.22/en/docs/user_manual/managing_data_source/opening_data.html?highlight=dwg#importing-a-dxf-or-dwg-file</a><o:p></o:p></p>
<p>Nicolas<o:p></o:p></p>
<div>
<p class="MsoNormal">On 2021-11-21 11:06 p.m., Jeff Sonnentag wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">Somebody must get the same quality of “engineering” that we do here.  :D</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">The last item received was in feet and aligns with California State Plane Zone 6, but they chopped off the first digit of both “X” and “Y” for everything.  Who knows why.  Maybe things
 run faster for them with 6 digit coordinates rather than 7 digit ones like you mentioned.  (???)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">Anyway, when I tried the simple drag and drop into QGIS 3.22 it never worked.  Always an error message about invalid data, even after I used DWG Trueview to convert it to the oldest
 possible versions (97/98 and 2000).  I did manage to get it in AFTER converting the DWG to a DXF with an online conversion site.  That DXF could be drug (I hate the word “dragged” – seems along the lines of “runned”) into QGIS and appeared OK.  Export to a
 shapefile and then do some affine adjustment magic and things can be worked with.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">Is there a reason that a DWG can’t be dropped into QGIS 3.22 but a DXF can?  Are there some DWG versions that just don’t work?  I thought I got a DWG to appear OK in 3.16, but maybe
 I just imagined it and used a DXF before too. . . .</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Qgis-user <a href="mailto:qgis-user-bounces@lists.osgeo.org">
<qgis-user-bounces@lists.osgeo.org></a> <b>On Behalf Of </b>Bernd Vogelgesang<br>
<b>Sent:</b> Sunday, November 21, 2021 10:53 AM<br>
<b>To:</b> Nicolas Cadieux <a href="mailto:njacadieux.gitlab@gmail.com"><njacadieux.gitlab@gmail.com></a>; Greg Troxel
<a href="mailto:gdt@lexort.com"><gdt@lexort.com></a>; Boaz Bar Ilan <a href="mailto:boazprosie@gmail.com">
<boazprosie@gmail.com></a><br>
<b>Cc:</b> qgis-user <a href="mailto:qgis-user@lists.osgeo.org"><qgis-user@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [Qgis-user] importing dwg/dxf<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On 21.11.21 15:35, Nicolas Cadieux wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, <br>
<br>
.dwg or dxf have no CRS.  They can be in inches, feet, mm, cm, m... Usually meter in a local CRS like a local WGS84 UTM ZONE is used.  You can usually find this in the metadata if available.
<br>
<br>
Nicolas <o:p></o:p></p>
</blockquote>
<p>I have no deep technical insight into dwg or dxf, but I am pretty sure that those  CAD-"products" are able to be produced with valid coordinates, fitting to a common CRS. Most people using CAD-systems simply seem to be either too stupid for that, or just
 do not care.<o:p></o:p></p>
<p>One of the reasons, CAD-"data" is produced with a local reference system instead with a normal CRS is, according to an CAD-operator I once asked about this, that some CAD-systems just slow down to in-operability when using real-world coordinates because
 of the huge numbers, compared to the small coordinates in their own system.<br>
<br>
So, I would not even try to fix this, but instead ask those guys to stop scratching their balls and better send you proper real-world data and tell you which CRS they are in . The handling of this "data" is punishment enough afterwords.<o:p></o:p></p>
<p>Hope my dislike for this "technology" was not too obvious ;)<o:p></o:p></p>
<p>Cheers,<o:p></o:p></p>
<p>Bernd<o:p></o:p></p>
<p> <o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
On 2021-11-21 9:07 a.m., Greg Troxel wrote: <br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Boaz Bar Ilan<a href="mailto:boazprosie@gmail.com"><boazprosie@gmail.com></a>  writes:
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">i always have problem importing dwg or dxf .  the layers  dont fit the
<br>
coardinations and even when i set the layers crs it doesnt work. <o:p></o:p></p>
</blockquote>
<p class="MsoNormal">I am far from an expert, but recently tried to deal with a dwg.
<br>
<br>
My impression is that they are almost always in local coordinates, and <br>
the path to success is something like using GeoScience plugin to define <br>
a local CRS based on control points where you know global coordinates <br>
and local, and then to use that CRS for the data. <br>
<br>
I recently imported some "PNEZD" data (csv with point it, northing, <br>
easting, vertical, and description, all in an unspecified local grid, <br>
from a total station data collector) and used geoscience to align it <br>
wtih RTK obsservations of a few points, and things fit quite well. <br>
<br>
How are you getting dwg?  Are you using the proprietary dwg library with <br>
gdal, or is there some open source path? <br>
<br>
_______________________________________________ <br>
Qgis-user mailing list <br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <br>
List <a href="info:https://lists.osgeo.org/mailman/listinfo/qgis-user">info:https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
<br>
Unsubscribe:<a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Qgis-user mailing list<o:p></o:p></pre>
<pre><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><o:p></o:p></pre>
<pre>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
<pre>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
</blockquote>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Nicolas Cadieux<o:p></o:p></pre>
<pre><a href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a><o:p></o:p></pre>
</div>
</body>
</html>