Draft: PathArray / PointArray broken

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
UR_
Posts: 1188
Joined: Tue Jan 03, 2017 8:42 pm

Draft: PathArray / PointArray broken

Postby UR_ » Fri Apr 03, 2020 11:29 am

Draft: PathArray needs 2 preseleted objects:
- base object
- path object

same with PointArray which needs
- base object
- point compound

If only one object is selected before command is invoked this error occurs:
Running the Python command 'Draft_PathArray' failed:
Traceback (most recent call last):
File "C:\Users\aio\Miniconda3\envs\freecad\Library\Mod\Draft\DraftTools.py", line 4661, in Activated
self.proceed()
File "C:\Users\aio\Miniconda3\envs\freecad\Library\Mod\Draft\DraftTools.py", line 4669, in proceed
path = sel[1].Object

list index out of range

if no objects are preselected this error occurs:

Please select base and path objects
Illegal storage access...
Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: Illegal storage access! Please save your work under a new file name and restart the application!
The event type 5 was sent to QOpenGLWidget
Object tree:
QOpenGLWidget is child of
SIM::Coin3D::Quarter::QuarterWidget is child of
QStackedWidget is child of
Gui::View3DInventor is child of
QMdiSubWindow is child of
QWidget is child of
QMdiArea is child of
Gui::MainWindowQPixmap::scaled: Pixmap is a null pixmap

test file:
Path_PointArray.FCStd
(13.55 KiB) Downloaded 3 times

tested with version:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20381 (Git)
Build type: Release
Branch: master
Hash: 2994b119971aefbf4752c09548a23f3d4a4bde3a
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
chrisb
Posts: 26941
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft: PathArray / PointArray broken

Postby chrisb » Fri Apr 03, 2020 12:30 pm

So where is the error? You need a selection of two, you give only one or none, and you get an error. I wouldn't say it's broken - although the message could be a bit more user friendly.
Syres
Posts: 754
Joined: Thu Aug 09, 2018 11:14 am

Re: Draft: PathArray / PointArray broken

Postby Syres » Fri Apr 03, 2020 12:40 pm

chrisb wrote:
Fri Apr 03, 2020 12:30 pm
You need a selection of two, you give only one or none, and you get an error.
It's a regression IMHO as in the past the user got a constructive feedback of "Please select base and path objects" in the Report View rather than the error quoted by @UR_
chrisb
Posts: 26941
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft: PathArray / PointArray broken

Postby chrisb » Fri Apr 03, 2020 12:59 pm

You are right, it is a regression. Still worked in this (now pretty old) version from right after the big merge:

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17798 (Git)
Build type: Release
Branch: master
Hash: 7e60631239109c632a8f6cca83f6e7e5502e43a1
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)