Macro error: No module named 'gui_arrays'

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
spanner888
Posts: 328
Joined: Tue May 28, 2019 10:51 am

Macro error: No module named 'gui_arrays'

Post by spanner888 »

In FC 0.19.20477:-

Recorded macro creating Draft array creation and when running macro, get error below.

Traceback (most recent call last):
File "C:/Users/spanner888/AppData/Roaming/FreeCAD/Macro/no_module_error.FCMacro", line 5, in <module>
import gui_arrays
<class 'ModuleNotFoundError'>: No module named 'gui_arrays'

Steps to reproduce:
Create new FC doc, add a default Part WB cylinder.
Switch to Draft WB & record a macro of creating a default Array of the cylinder.
Stop recording macro
Delete array
Select cylinder, run macro.


workarounds I have found are to
add either:
import DraftGui
or
import Draft

AND comment out
#import gui_arrays
#import gui_orthoarray
#import gui_polararray

Note original macro also added a polar array and tweaked the default array, hence the two additional imports.

Issue does not occur in FC 0.18 and macro does have "import DraftGui" and does NOT have the 3 problematic imports.

Possibly related to this commit which seems to have removed "import DraftGui"

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20477 (Git)
Build type: Release
Branch: master
Hash: 7d8ab175a68e476427e6e337fe3099b52da49dc8
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
Post Reply