New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DXF Importer (legacy) groups layers differently depending on open or import command #13621
Closed
2 tasks done
Labels
Comments
2 tasks
Roy-043
added a commit
to Roy-043/FreeCAD
that referenced
this issue
Apr 27, 2024
Fixes FreeCAD#13621. Currently the legacy DXF importer creates a main group with the DXF name if a DXF is imported into an existing FreeCAD document. For each DXF layer it then creates a sub-group (or Draft Layer) inside that main group. Objects are nested in the sub-groups (or Draft Layers). This does not make sense for Draft Layers as they should be nested in the LayerContainer, which should be in the root of the FreeCAD document. Both for Draft Layers and sub-groups there is the issue that if mutliple DXF files are imported in the same FreeCAD document, exising Draft Layers and sub-groups are not taken into account. For each DXF a new "0" group/layer is created (with a Label that is not "0" and therefore not recognized), and if there are objects on that layer a new group/layer is created for each object (labelled "0001", "0002", "0003", etc). To solve this the main group with the DXF name is no longer created in the revised code and the layers variable is initialized with the groups/layers that already exist in the FreeCAD document. Additionally the formatObject function should not format objects that are in Draft Layers. Its action conflicts with the layer mechanism resulting in the last imported object having an incorrect color.
yorikvanhavre
pushed a commit
that referenced
this issue
Apr 29, 2024
Fixes #13621. Currently the legacy DXF importer creates a main group with the DXF name if a DXF is imported into an existing FreeCAD document. For each DXF layer it then creates a sub-group (or Draft Layer) inside that main group. Objects are nested in the sub-groups (or Draft Layers). This does not make sense for Draft Layers as they should be nested in the LayerContainer, which should be in the root of the FreeCAD document. Both for Draft Layers and sub-groups there is the issue that if mutliple DXF files are imported in the same FreeCAD document, exising Draft Layers and sub-groups are not taken into account. For each DXF a new "0" group/layer is created (with a Label that is not "0" and therefore not recognized), and if there are objects on that layer a new group/layer is created for each object (labelled "0001", "0002", "0003", etc). To solve this the main group with the DXF name is no longer created in the revised code and the layers variable is initialized with the groups/layers that already exist in the FreeCAD document. Additionally the formatObject function should not format objects that are in Draft Layers. Its action conflicts with the layer mechanism resulting in the last imported object having an incorrect color.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Problem description
Refer to screenshot below. The expanded treeviews show the result of importing a DXF twice, using either File > Open or File > Import:
Layers
parentLayers
parent layer does not contain any layerFull version info
Subproject(s) affected?
File formats
Anything else?
Importer settings that I used:
Files to reproduce:
Code of Conduct
The text was updated successfully, but these errors were encountered: