CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 9036

CAD tip CAD tip # 13938:

Question CAD 
 %  platform  category 
Q - question

ModDXF - utility for bulk modification/display of internal DXF properties in DWG entities.

A - answer Using the flexible LISP utility ModDXF you can edit internal properties (DXF codes) of individual objects in the DWG file database. It is a general purpose utility for direct editing of DXF properties, which you can display e.g. by the LISP command (entget(car(entsel))), without the need for any AutoCAD editing commands, and often with wider possibilities.

For example, you can mass recalculate colors, change arc radii, text heights, block rotation and scaling, point positions, and much more. With a selected DXF code (e.g. 8=layer, 1=text, 62=color...) you can perform various operations on selected objects containing this DXF code (=property) - increase the value of the code/property by a specified constant, multiply it, round it, add a prefix to a text property or process it with a regular expression, or even delete it completely (carefully!).

It is also possible to process multiple properties occurring multiple times in the entity data (e.g. 10 - coordinates of points in curves, 300 codes for MEP objects, etc.) - you can select individual instances according to their order.

Property processing can also be limited to properties that have certain values - e.g. only text sizes larger than 12, only blocks of scale 1, etc.

Since V1.2 you can also modify entities in block definitions.

Download the ModDXF application from Download, load it into your AutoCAD using APPLOAD and run it by typing the MODDXF command. Since V1.3 you can also use ShowDXF, DXFI and DXFJ.

In the first prompt in ModDXF, "Select DXF group", you enter the DXF code number to be processed (the question mark lists the most used property codes). At the "Pre-select objects" prompt, you select the objects you will modify, or the bLock option for blocks (the inverse option allBut or Unconditional is for adding properties, so they may not yet exist in the object). The "Multi-instances" prompt optionally selects specific instances for multiple occurring properties in a single entity - e.g., curve vertices (10), MEP-properties (300), table texts (1), etc. Thus, you can change only the first, second, last, only even/odd ones or e.g. only the 3rd to 7th properties. The "Just values" option allows you to process only values that have a existing value in some range. The final "Operation to perform" prompt specifies the type of operation on the property - Replace (replacing an existing value with a new one), Add (adding a specified value), Multiply (multiplying by a coefficient), Round (rounding to specific steps of values), Regex (replacing text with regular expressions), etc. The Delete option deletes the DXF value, the Insert option adds a new value (it must not already exist).

Examples of use (and the given DXF group number) - some are difficult to solve with AutoCAD editing commands:

  • color-shift on object colors (62)
  • bulk text editing (prefixes, suffixes, regular expressions; 1)
  • changing styles (text, tables...; 7)
  • moving entities (including bulk move of selected vertices, e.g. every other; 10)
  • rounding the position of entities to fixed spacing, grid (10)
  • unification of sizes, scales (40)
  • delete overwriting of colors or thicknesses (420,370)
  • bulk polyline close (70)
  • changing spline node weights (40)
  • changing only height or only width of raster images (11, 12)
  • reset entity orientation in UCS (210)
  • add new vertex as 3rd vertex to all selected LWPolylines (10)
  • edit block definitions (e.g. ByBlock colors, texts)
  • and many more

Note, there are no major checks on allowable property changes for now. Use is for experts, you are manipulating the internal DWG database directly!


  • angle values are in radians
  • enter vector values as a triplet X,Y,Z
  • do not confuse the Add operation (adding a value) with the Insert operation (adding a new value for a DXF property that does not yet exist)
  • changing a layer (8) to a new one will auto-create it, but e.g. a text style (7) will not
  • some properties cannot be added in this way with just Insert, they require additional operations, e.g. Wipeout

The ShowDXF command allows to dynamically display selected DXF properties when moving your mouse cursor over DWG entities. With the "S" key you can enter the comma-delimited list of DXF codes to show. The "C" key will cycle colors of the dynamic label.

The DXF code list can also contain specification for order (for multiple codes) or range - e.g. 10|3 (just the 3rd coordinate), or 10|4-8 (just the 4th to 8th coordinates).

The auxiliar commands DXFI and DXFJ (justified) will show the DXF contents of a selected entity.

100% *  CAD 
27.11.2023    71019×  

See also:
Tip 13900:How to convert truecolor color hue to the nearest AutoCAD ACI color?
Tip 10118:How to export a DXF file with punch points from an unfold?
Tip 10015:How to select and modify objects in ALL layouts of the DWG?
Tip 8532:Import of 3D DWF files back to editable 3D models.
Tip 8183:Convert surface (mesh) model to 3D solid body.

Back   All CAD Tips

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info

Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.