[general]
name=CartoDXF
qgisMinimumVersion=3.16
qgisMaximumVersion=4.99
description=Export QGIS vector layers to a professional DXF, one DXF layer per category, with real colors, line widths and line types. / Exporta capas vectoriales de QGIS a un DXF profesional, una capa DXF por categoría, con colores, grosores y tipos de línea reales.
version=1.5.0
author=Kiko Molina
email=kmlidar@outlook.com
about=QGIS plugin to export loaded vector layers (points, lines, polygons) to a single
    professional DXF file, ready to open in AutoCAD or any CAD software.

    Main features:
    - One DXF layer per category: choose a field per QGIS layer to split it into
      several DXF layers automatically (e.g. one DXF layer per road type, per land use...).
    - Independent label/text field: write any field value as DXF text next to each
      feature, regardless of the field used for the DXF layer name.
    - Exact colors (true color RGB) read from the QGIS symbology, plus an automatic
      ACI fallback for older DXF viewers that don't support true color.
    - Real line widths and line types (dashed, dotted, dash-dot...) taken from the
      QGIS simple line symbology.
    - Polygons exported with fill (hatch) and independent outline: solid fill or
      a selectable pattern (diagonal lines, horizontal lines, grid, dots) with
      adjustable scale; optional setting to make the outline match the fill
      color, useful with "Categorized" renderers where only the fill color
      varies.
    - Points exported as DXF POINT entities, with an option to also insert a DXF
      block (INSERT) approximating the QGIS marker shape (circle, square, triangle,
      diamond, cross, X, star, pentagon, hexagon...).
    - Optional export limited to the current canvas view, with geometries clipped
      to that extent instead of exported whole.
    - Text labels try to preserve their QGIS orientation (data-defined rotation,
      or the line's own direction for road-name style labels) instead of always
      being exported horizontal.
    - Automatic reprojection to the QGIS project CRS.
    - A faulty feature (invalid geometry, unusual category value...) is skipped
      instead of aborting the whole export.

tracker=https://github.com/kmlidar/CartoDXF/issues
repository=https://github.com/kmlidar/CartoDXF
changelog=
    1.5.0
    - Added: new "Auto-detect (match QGIS)" button above the layer
      table. Sets up the export to match what you currently see in
      QGIS without having to review every layer by hand:
        · Includes only the layers that are visible (checked) in the
          QGIS Layers panel; layers that are off, or inside an off
          group, get unchecked here.
        · If a layer uses a "Categorized" renderer, uses that same
          field as "DXF layer", so the grouping in the DXF matches the
          categories you see in QGIS.
        · Detects the active label field/expression in QGIS and copies
          the text size (if set in map units) and text color
          configured on the label.
      Can be clicked more than once: each time it re-reads the current
      project state and overwrites these settings on every layer.
    - Fixed: layers whose QGIS labeling used an EXPRESSION (concatenating
      several fields, CASE, functions...) instead of a plain field used
      to export with no text at all, silently, because the exporter
      only knew how to read the value of a field whose name matched
      exactly. Now, if the "Text/label" value isn't a real field of the
      layer, it's treated as a QGIS expression and evaluated per
      feature. The "Auto-detect" button already selects these
      expressions automatically; they can also be pasted manually into
      the dropdown.
    - Added: when a single QGIS layer actually groups many heterogeneous
      "sub-layers" through a field (e.g. a shapefile with an AutoCAD
      LAYER field, categorized) and labeling is set to "Rule-based" with
      more than one rule (or a single rule with its own filter), the
      "Auto-detect" button now selects a special "QGIS labeling rules"
      mode: during export, each feature is labeled according to the
      FIRST rule whose filter it matches (or gets no text if it matches
      none), instead of blindly applying the first rule's field to the
      whole layer. Each matched rule's own text size and color are used
      as well, instead of falling back to the general settings for
      every rule; when the rule's size is set in points/millimeters
      rather than map units (no exact conversion is possible without
      knowing the project's print scale), the general text height is
      scaled proportionally so relative size differences between rules
      are still preserved.
    - Fixed: a category left without fill in QGIS — either via a
      Simple Fill layer set to "No Brush", or via the common technique
      of using an outline-only "Simple Line" layer with no fill layer
      at all — could still export filled in the DXF, using the last
      color the fill layer had stored (or a generic fallback color for
      the outline-only case). Fill detection now only considers a
      category filled if an actual fill-type symbol layer is present
      and enabled, matching what QGIS renders on screen.

    1.4.0
    - Changed: the CartoDXF panel is no longer a modal window that blocked
      the rest of QGIS (map canvas, other panels...) until closed. It is
      now a dockable panel, like QGIS's own "Layers" or "Browser" panels:
      it can stay open while you keep working on the map, and it can be
      docked to any side of the QGIS window by dragging its title bar, or
      left floating (the default, matching the previous look).
    - The layer table now stays in sync while the panel remains open: new
      layers added to the project appear automatically, and removing a
      layer that was already listed refreshes the table, without losing
      the per-layer settings (DXF field, label field, text size/color)
      already configured for the other layers.

    1.3.1
    - Fixed: the layer list showed each row as an independent widget, so
      the "DXF layer" and "Text/label" columns drifted out of alignment
      depending on how long each layer's name was. All rows now share a
      single table (grid) layout, so every column lines up regardless of
      layer name length.
    - Added: per-layer text size and text color for exported labels, with
      an "Auto" default (uses the general text height / the feature's own
      color, as before) that can be overridden individually per layer.
    - Fixed: on small screens/laptops, the dialog window could end up
      taller than the screen, pushing the "Export" button out of view and
      only reachable with the Tab key. The layers and options sections are
      now scrollable on their own, while the output path, progress bar and
      buttons stay pinned and always visible.

    1.3.0
    - Fixed: Rule-based renderers (e.g. a building style with scale-dependent
      "shadow" sub-rules) could resolve to no symbol at all when exporting
      outside QGIS's normal canvas render pipeline, so the whole DXF layer
      silently fell back to plain black. Rules are now matched manually,
      ignoring their scale range (a DXF has no viewing scale), so the
      correct rule and its real color are used.
    - Improved: fill-color extraction now also covers advanced fill symbol
      layer types beyond Simple Fill (gradient, shapeburst, texture/raster,
      point/line pattern, centroid fill with marker...), instead of leaving
      the color unresolved and defaulting to black.
    - Fixed: the render context used to resolve QGIS symbology is now built
      from the actual current map canvas settings instead of an empty one,
      so scale- and extent-aware styling resolves correctly.
    - Added: "Export only features within the current canvas view" option.
      Previously every export used all features in a layer's data source,
      so a layer with no filter of its own (subset string) was always
      exported in full, even if you were just zoomed into part of it
      (e.g. a whole province instead of a single municipality).
    - Fixed: with the option above, features that only partly overlapped
      the exported view used to be exported whole. Geometries are now
      clipped to that rectangle instead of just included/excluded by a
      bounding-box test.
    - Added: exported text labels now try to preserve their QGIS
      orientation instead of always being horizontal, using the label's
      own data-defined rotation field/expression when set, or, for labels
      on line features (e.g. street names), an angle approximated from the
      line's own direction at the label point.

    1.2.1
    - Fixed: Qt6 compatibility issue. Geometry type comparisons used the old
      unscoped enum syntax (e.g. QgsWkbTypes.Point), which is invalid in the
      newer, strictly-scoped PyQt6/PyQGIS API. Changed to the scoped form
      (QgsWkbTypes.Type.Point) throughout the export code.
    - Fixed: the automatic ezdxf installer could report success and still leave
      the plugin unable to import it (ModuleNotFoundError right after
      installing). This happened because it installed into the user's
      "--user" site-packages folder, which QGIS's bundled Python often does
      not search. It now installs into a private folder inside the plugin
      itself and adds it directly to the Python path, so it no longer
      depends on that setting.

    1.1.1
    - Fixed: on Linux, automatic installation of the ezdxf library could fail
      with no clear explanation, due to the "externally-managed-environment"
      protection present in recent Ubuntu/Debian Python installations. The
      plugin now tries several installation strategies automatically, and if
      it still fails, the error message shows the real reason and how to
      install ezdxf manually.

tags=DXF, DWG, CAD, AutoCAD, export, vector, layers, categories, true color, cartografia, vector, capas, exportar
homepage=https://github.com/kmlidar/CartoDXF
donate=https://www.paypal.com/donate/?hosted_button_id=UF9SYUY42GWTG
category=Vector
license=GPLv2
icon=icons/icon.png
experimental=False
deprecated=False
