Various problems with the window type example in the wiki

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
hko
Posts: 96
Joined: Thu Apr 23, 2020 10:44 pm

Various problems with the window type example in the wiki

Post by hko »

- Download Window_Type.FCStd from https://wiki.freecadweb.org/Arch_Window, section "Defining window types" and open it
- Select Arch workbench
- Select wall face and set working plane to that face
- Select Window 01
- Click Draft Move tool and move the window a bit to the right on the wall (restrict changes to x coordinate only)
- Observe the following error:
"Part::FeaturePython: Link(s) to object(s) 'Extrude002' go out of the allowed scope 'Window'. Instead, the linked object(s) reside within 'Part Part'."
- Delete Window 02 and Window 01
- Observe that wiki says "Our window type is now ready. We can create window objects from it, simply by selecting the App Part and pressing the window button." - let's try to recreate one window "instance":
- Select "Type window" in the tree view
- Click Arch Window tool
- Observe the following error:
Running the Python command 'Arch_Window' failed:
Traceback (most recent call last):
File "/usr/local/freecad-latest/Mod/Arch/ArchWindow.py", line 228, in Activated
FreeCADGui.doCommand("Arch.makeWindow(FreeCAD.ActiveDocument."+obj.Name+")")
File "<string>", line 1, in <module>
File "/usr/local/freecad-latest/Mod/Arch/ArchWindow.py", line 120, in makeWindow
obj.Base.ViewObject.DisplayMode = "Wireframe"

'Wireframe' is not part of the enumeration in Window_Type#Part.ViewObject.DisplayMode
Despite the error, a new Window can be seen in the tree view (it doesn't seem to be visible in the 3D view).

- Window appears to need recomputing - recompute it
- Select Window and Wall, in that order, and click Arch Add
- Observe that the window appears on the wall

- Edit Material property of the Window and select "Window material"
- Observe that Material property displays "MultiMaterial (Window material)" as the value
- Click somewhere else to unselect the Window
- Select Window again to view its properties
- Observe that Material property is not set anymore

- Edit Material property of the Window and select "Window material"
- Recompute the Window via the context menu
- Observe that Material is not set anymore in this case either

Code: Select all

OS: Ubuntu 20.04.5 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: recent master, see hash
Build type: Debug
Branch: master
Hash: 8b85903dffe3a9a02dd3738ea8931f3e52e59463
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.3.0
Locale: English/United States (en_US)
Installed mods: 
  * 3DfindIT 1.2.0
  * Render 2022.3.0
  * BIM 2021.12.0
  * Reinforcement
  * Manipulator 1.4.9
  * Assembly4.backup1662941442.2770898
  * parts_library
  * Assembly4 0.12.5
  * fasteners 0.4.50
  * Silk 1.0.0
  * dodo 1.0.0
  * Curves 0.6.5
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Various problems with the window type example in the wiki

Post by paullee »

Do not understand the problem of App:Part, though noted some problem in the multi-materials :)
  1. The Multi-Materials 'Window Materials' contain 4 inputs
  2. Double-clicking it, a dialog box shows up for editing
  3. Click the '...' of the Material Property, another dialog comes up
  4. Note shows 3 selected objects - though it show be 4 with 2 repeated
  5. Click Cancel, now it has a Recompute sign, recompute it
  6. Now, it contains only 3 materials with 4 Names; there are error message in Report window; double-clicking the material has no dialog box comes up

Screenshot from 2022-12-27 08-48-31.png
Screenshot from 2022-12-27 08-48-31.png (204.6 KiB) Viewed 770 times
Screenshot from 2022-12-27 08-48-40.png
Screenshot from 2022-12-27 08-48-40.png (188.59 KiB) Viewed 770 times
Screenshot from 2022-12-27 08-48-48.png
Screenshot from 2022-12-27 08-48-48.png (35.56 KiB) Viewed 770 times
Screenshot from 2022-12-27 08-48-53.png
Screenshot from 2022-12-27 08-48-53.png (203.44 KiB) Viewed 770 times
Screenshot from 2022-12-27 08-49-49.png
Screenshot from 2022-12-27 08-49-49.png (91.44 KiB) Viewed 770 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Various problems with the window type example in the wiki

Post by Roy_043 »

4 issues then:

1. Allowed scope:
This can be fixed by changing the Subvolume property type in the code from "App::PropertyLink" to "App::PropertyXLink".

2. DisplayMode:
Line 120 can be removed I think.

3. Material property cannot be set:
This is caused by an expression. This expression can be remove by right-clicking the property in the Property editor, selecting "Expression" from the context menu, and then pressing the Clear button. IMO the code should check if the Material property of the base object contains valid data before applying the expression. Note that you can assign "Window material" to the Material property of the Std_Part. But this multi-material is not used for the part itself.

4. Duplicate materials in multi-materials:
That is harder to solve. The Materials property of the multi-material can contain duplicates, but the code for the dialog does not handle this. Using 2 aluminium materials would of course avoid the problem.
Post Reply