View Issue Details

IDProjectCategoryView StatusLast Update
0004027FEMBugpublic2019-06-21 14:34
Reporterh.tsubota Assigned ToKunda1  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSWindows 10OS Version10.0.17763 
Product Version0.18 
Summary0004027: Material settings can not be edited in FEM workbench
DescriptionIn FEM workbench, I click the material in model tree to edit the material. But a dialog show and say "Active Task Dialog found! Please close this one before opening a new one!", but there is no Active Task Dialog in Task tab. So I cannot edit the material.
Steps To Reproduce1. Open FreeCAD
2. Press the "create a new empty document" button
3. Switch to the Part workbench
4. Press the "create a cube solid" button
5. Switch to the FEM workbench
6. Press the "Creates an analysis container with standard solver CalculiX(N, A)" button
7. Press the "Creates a FEM material for solid(M,M)" button
8. Click the "SolidMaterial" in tree of Model tab
9. Show an Error dialog and I cannot create material setting. The dialog says "Active Task Dialog found! Please close this one before opening a new one!", but there is no Active Task Dialog in Task tab.
Additional Information# FreeCAD version information

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Japanese/Japan (ja_JP)

# FreeCAD error messages in Report view

Traceback (most recent call last):
  File "C:\Program Files\FreeCAD 0.18\Mod\Fem\femguiobjects\_ViewProviderFemMaterial.py", line 71, in setEdit
    taskd = _TaskPanelFemMaterial(self.Object)
  File "C:\Program Files\FreeCAD 0.18\Mod\Fem\femguiobjects\_ViewProviderFemMaterial.py", line 151, in __init__
    self.import_materials()
  File "C:\Program Files\FreeCAD 0.18\Mod\Fem\femguiobjects\_ViewProviderFemMaterial.py", line 574, in import_materials
    self.import_solid_materials()
  File "C:\Program Files\FreeCAD 0.18\Mod\Fem\femguiobjects\_ViewProviderFemMaterial.py", line 581, in import_solid_materials
    self.add_cards_from_a_dir(system_mat_dir, ":/icons/freecad.svg")
  File "C:\Program Files\FreeCAD 0.18\Mod\Fem\femguiobjects\_ViewProviderFemMaterial.py", line 620, in add_cards_from_a_dir
    self.materials[a_path] = Material.importFCMat(a_path)
  File "C:\Program Files\FreeCAD 0.18\Mod\Material\Material.py", line 65, in importFCMat
    Config.read(fileName)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\configparser.py", line 697, in read
    self._read(fp, filename)
  File "C:\Program Files\FreeCAD 0.18\bin\lib\configparser.py", line 1015, in _read
    for lineno, line in enumerate(fp, start=1):
<class 'UnicodeDecodeError'>: 'cp932' codec can't decode byte 0x93 in position 586: illegal multibyte sequence
Active Task Dialog found! Please close this one before opening a new one!
Active Task Dialog found! Please close this one before opening a new one!

# Comment

I found non-ascii characters in FCMat files in "C:\Program Files\FreeCAD 0.18\data\Mod\Material\StandardMaterial" (like "Acrylic-Glass-Generic.FCMat" etc...).
And encoding has not been set in importFCMat(fileName) function in "C:\Program Files\FreeCAD 0.18\Mod\Material\Material.py".

So I tried to change "Config.read(fileName)" to "Config.read(fileName, encoding='utf-8')" on line 65 in "C:\Program Files\FreeCAD 0.18\Mod\Material\Material.py".
The problem may be fixed by the editing.
TagsFEM, material
FreeCAD Information

Activities

Kunda1

2019-06-18 13:28

administrator   ~0013253

When it comes to FEM and Materials please always test the latest 0.19dev version. Both the FEM Workbench and Materials (IFC, BIM etc...) are very hot when it comes to development.

Is this the line you're referring to?
https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Material/Material.py#L73

Kunda1

2019-06-18 13:43

administrator   ~0013254

FreeCAD Pull Request 2269

h.tsubota

2019-06-18 14:52

reporter   ~0013255

Last edited: 2019-06-18 15:01

Thank you for your response. The line that you refer is correct.
I see. If I found a bug next time in FEM/Material, I will test it in latest dev version.

berndhahnebach

2019-06-19 20:14

developer   ~0013261

Last edited: 2019-06-19 20:14

I can not hardly belive this fixed your problem ... The fixed was applied in the depretiated not used importer ... https://github.com/FreeCAD/FreeCAD/blob/798a9102659d246bfda1a91f78b6032d0940fe64/src/Mod/Material/Material.py#L55-L57

Kunda1

2019-06-19 20:16

administrator   ~0013262

Fix committed to master branch.

berndhahnebach

2019-06-21 05:11

developer   ~0013285

just wanted to add a note ...

Just realised he is right. In 0.18 the mat card reader from Material.py is used in FEM Material panel. Thus he had thir error. Thus we should backport the fix to 0.18. I will make a post in the forum topic.

berndhahnebach

2019-06-21 05:14

developer   ~0013286

https://forum.freecadweb.org/viewtopic.php?f=10&t=35350&p=315694#p315694

berndhahnebach

2019-06-21 05:15

developer   ~0013287

this could be closed the fix is in 0.18 branch too.

Kunda1

2019-06-21 14:34

administrator   ~0013288

Fix committed to releases/FreeCAD-0-18 branch.

Related Changesets

FreeCAD: master 75b52c85

2019-06-18 13:41:14

Kunda1


Committer: berndhahnebach Details Diff
[Material] Respect unicode filenames

Fixes 0004027
Affected Issues
0004027
mod - src/Mod/Material/Material.py Diff File

FreeCAD: releases/FreeCAD-0-18 90ff921e

2019-06-18 13:41:14

Kunda1


Committer: wmayer Details Diff
[Material] Respect unicode filenames

Fixes 0004027
Affected Issues
0004027
mod - src/Mod/Material/Material.py Diff File

Issue History

Date Modified Username Field Change
2019-06-18 09:27 h.tsubota New Issue
2019-06-18 09:27 h.tsubota Tag Attached: 0.18
2019-06-18 09:27 h.tsubota Tag Attached: FEM
2019-06-18 09:27 h.tsubota Tag Attached: material
2019-06-18 13:28 Kunda1 Note Added: 0013253
2019-06-18 13:42 Kunda1 Tag Detached: 0.18
2019-06-18 13:43 Kunda1 Note Added: 0013254
2019-06-18 13:43 Kunda1 Assigned To => Kunda1
2019-06-18 13:43 Kunda1 Status new => assigned
2019-06-18 14:52 h.tsubota Note Added: 0013255
2019-06-18 15:01 h.tsubota Note Edited: 0013255
2019-06-19 18:00 Kunda1 Target Version => 0.19
2019-06-19 20:14 berndhahnebach Note Added: 0013261
2019-06-19 20:14 berndhahnebach Note Edited: 0013261
2019-06-19 20:16 berndhahnebach Changeset attached => FreeCAD master 75b52c85
2019-06-19 20:16 Kunda1 Note Added: 0013262
2019-06-19 20:16 Kunda1 Status assigned => closed
2019-06-19 20:16 Kunda1 Resolution open => fixed
2019-06-19 22:43 Kunda1 Fixed in Version => 0.19
2019-06-21 05:11 berndhahnebach Status closed => feedback
2019-06-21 05:11 berndhahnebach Resolution fixed => reopened
2019-06-21 05:11 berndhahnebach Note Added: 0013285
2019-06-21 05:14 berndhahnebach Note Added: 0013286
2019-06-21 05:15 berndhahnebach Note Added: 0013287
2019-06-21 14:34 wmayer Changeset attached => FreeCAD releases/FreeCAD-0-18 90ff921e
2019-06-21 14:34 Kunda1 Note Added: 0013288
2019-06-21 14:34 Kunda1 Status feedback => closed
2019-06-21 14:34 Kunda1 Resolution reopened => fixed