Blender import DXF with option to use blocks as group instance fails #95892

Open
opened 2022-02-19 18:28:35 +01:00 by Dimitar P. · 3 comments

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39

Blender Version
Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: blender/blender@dc2d180181

Addon Information
Name: Import AutoCAD DXF Format (.dxf) (0, 9, 6)
Author: Lukas Treyer, Manfred Moitzi (support + dxfgrabber library), Vladimir Elistratov, Bastien Montagne, Remigiusz Fiedler (AKA migius)

Short description of error
When triying to import a DXF file with blocks. The default settings work well. However, if changing the option for block from linked objects to group instances, I get the following error:

Python: Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\__init__.py", line 539, in execute
    read(self.report, self.filepath, merge_options, self.import_text, self.import_light, self.export_acis,
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\__init__.py", line 119, in read
    errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene)
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1628, in entities
    self.separated_entities((en for en in self.dwg.modelspace() if is_.separated_entity(en)), scene)
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1605, in separated_entities
    _do_it(en)
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1592, in _do_it
    o = self._call_object_types(en.dxftype, [en], group, name, scene, separated=True)
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1380, in _call_object_types
    o = type_func(entity, scene, name)
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1043, in insert
    o = self.block_group_instances(self.dwg.blocks[entity.name], scene, entity.name, group,
  File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 970, in block_group_instances
    bpy.context.screen.scene = block_scene
AttributeError: 'Screen' object has no attribute 'scene'

location: <unknown location>:-1

It looks like there may be some old code that needs to be updated

Exact steps for others to reproduce the error

  • Go to {nav File > Import > Autocad DXF}
  • Change the option block from Linked Objects to Group Instances
  • Try to import the attached .dxf file (DXF file with blocks).
    Circle_Block.dxf
**System Information** Operating system: Windows-10-10.0.19042-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39 **Blender Version** Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: `blender/blender@dc2d180181` **Addon Information** Name: Import AutoCAD DXF Format (.dxf) (0, 9, 6) Author: Lukas Treyer, Manfred Moitzi (support + dxfgrabber library), Vladimir Elistratov, Bastien Montagne, Remigiusz Fiedler (AKA migius) **Short description of error** When triying to import a DXF file with blocks. The default settings work well. However, if changing the option for block from linked objects to group instances, I get the following error: ``` Python: Traceback (most recent call last): File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\__init__.py", line 539, in execute read(self.report, self.filepath, merge_options, self.import_text, self.import_light, self.export_acis, File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\__init__.py", line 119, in read errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene) File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1628, in entities self.separated_entities((en for en in self.dwg.modelspace() if is_.separated_entity(en)), scene) File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1605, in separated_entities _do_it(en) File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1592, in _do_it o = self._call_object_types(en.dxftype, [en], group, name, scene, separated=True) File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1380, in _call_object_types o = type_func(entity, scene, name) File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 1043, in insert o = self.block_group_instances(self.dwg.blocks[entity.name], scene, entity.name, group, File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.0.1.0_x64__ppwjx1n5r4v9t\Blender\3.0\scripts\addons\io_import_dxf\dxfimport\do.py", line 970, in block_group_instances bpy.context.screen.scene = block_scene AttributeError: 'Screen' object has no attribute 'scene' location: <unknown location>:-1 ``` It looks like there may be some old code that needs to be updated **Exact steps for others to reproduce the error** - Go to {nav File > Import > Autocad DXF} - Change the option block from `Linked Objects` to `Group Instances` - Try to import the attached .dxf file (DXF file with blocks). [Circle_Block.dxf](https://archive.blender.org/developer/F12914627/Circle_Block.dxf)
Author

Added subscriber: @Dimitar

Added subscriber: @Dimitar

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#95892
No description provided.