Import: improve DXF C++ importer support for BLOCK and INSERT entities (#22045)
* Import: DXF importer, block and inserts overhaul Implement support for blocks as definitions and inserts as instances. A BLOCK definition becomes a hidden master object in a _BlockDefinitions group (currently a Part::Compound). An INSERT becomes a visible App::Link that points to that master definition. * Import: DXF parser/importer add debug print statements * Import: DXF importer, various improvements - Add more code comments - Correctly increase object count - Improve readability of anonymous block checks * Import: DXF (all) report anonymous blocks separately * Import: DXF importer (App + GUI) add nested inserts support * Import: DXF importer (GUI) fix preserving colors for inserts * Import: DXF importer, make primitives naming more specific * Import: DXF parser/importer remove debug print statements * Import: DXF parser, work around DXF color index 7 * Import: DXF importer GUI, temporary debug print to show layer color data * Import: DXF importer, fix nested inserts hierarchy * Import: DXF importer, prefix and suffix underscores to names To work around mangling from FreeCAD's unique name generator. * Import: DXF importer, implement flattening blocks on import * Revert "Import: DXF importer GUI, temporary debug print to show layer color data" This reverts commit b6ece395c9d2b8a1e0796d6f7b0d58842a2f3686. * Import: DXF importer, fix imported text orientation The DXF file provides the text rotation angle in degrees. The used rotZ function expects the angle in radians, thus the conversion needs to be made. Fixes: #21548 * Import: DXF importer, honour the preference to not import layouts * Import: DXF importer, move unreferenced blocks to separate group This provides better classification, but it has a performance hit: we import all blocks as before, we sort them and we reparent them to the correct group. The reparentipart with Grou.setValues() appears to be an expensive call. Probably because internally the FreeCAD dependency graph is modified. * Import: DXF importer, count compound children in the report * Import: DXF importer, cleanup defined blocks group if empty
This commit is contained in:
@@ -4296,6 +4296,18 @@ class DxfImportReporter:
|
||||
else:
|
||||
lines.append(" (No entities recorded)")
|
||||
lines.append(f"FreeCAD objects created: {self.stats.get('totalEntitiesCreated', 0)}")
|
||||
|
||||
lines.append("")
|
||||
|
||||
# System Blocks
|
||||
lines.append("System Blocks:")
|
||||
system_blocks = self.stats.get('systemBlockCounts', {})
|
||||
if system_blocks:
|
||||
for key, value in sorted(system_blocks.items()):
|
||||
lines.append(f" - {key}: {value}")
|
||||
else:
|
||||
lines.append(" (None found or imported)")
|
||||
|
||||
lines.append("")
|
||||
if has_unsupported_indicator:
|
||||
lines.append("(*) Entity type not supported by importer.")
|
||||
|
||||
Reference in New Issue
Block a user