CAD tip # 13938:
Question
For example, you can mass recalculate colors, change arc radii, text heights, block rotation and scaling, point positions, mask colors 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 inside 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)
- changing MText mask color to BYLAYER (63 code to the value of 256)
- 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!
NOTES:
- 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).
See sample video:
The auxiliar commands DXFI and DXFJ (justified) will show the DXF contents of a selected entity.


