Skip to content
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

Draft: Legacy DXF importer: fix layer block behavior #18129

Conversation

Roy-043
Copy link
Contributor

@Roy-043 Roy-043 commented Nov 25, 2024

Fixes #16550.
Fixes #16552.

  • Layer blocks receive a name with the "LayerBlock_" prefix.
  • They are put in a layer if the "Use layer" import option is checked.
  • If Draft or Sketch objects are created a Part_Compound instead of a Draft_Block is created. This was done because a Draft_Block does not claim its children. I am not sure about this change. Maybe the behavior of the Draft_Block should be changed instead.

@yorikvanhavre: do you know why a Draft_Block does not claim its children?

Fixes FreeCAD#16550.
Fixes FreeCAD#16552.

* Layer blocks receive a name with the "LayerBlock_" prefix.
* They are put in a layer if the "Use layer" import option is checked.
* If Draft or Sketch objects are created a Part_Compound instead of a Draft_Block is created. This was done because a Draft_Block does not claim its children. I am not sure about this change. Maybe the behavior of the Draft_Block should be changed instead.

@yorikvanhavre: do you know why a Draft_Block does not claim its children?
@Roy-043 Roy-043 added the Mod: Draft Related to the Draft Workbench label Nov 25, 2024
@Roy-043 Roy-043 marked this pull request as ready for review December 4, 2024 10:12
@yorikvanhavre
Copy link
Member

@yorikvanhavre: do you know why a Draft_Block does not claim its children?

That Draft Block object is very, very old... Maybe from a time before claimChildren() existed. IMHO we could think of obsoleting it, it's mostly redundant with part compounds...

@Roy-043
Copy link
Contributor Author

Roy-043 commented Dec 4, 2024

Let's merge then.

@Roy-043 Roy-043 merged commit 7a7c042 into FreeCAD:main Dec 4, 2024
10 checks passed
@Roy-043 Roy-043 deleted the Draft-Legacy-DXF-importer-fix-layer-block-behavior branch December 4, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Draft Related to the Draft Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DXF importer (Python): blocks are imported outside their layers DXF importer (Python): geometry is imported individually even if "Group layers into blocks" is selected
2 participants