Improvement: Draft Array should gracefully handle objects that cannot be arrayed

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
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Improvement: Draft Array should gracefully handle objects that cannot be arrayed

Post by vocx »

While testing the Draft Array command I realize some objects like Draft Text and Draft Dimension cannot be turned into arrays. Either the internal command Draft.makeArray(), or the graphical command Array() defined in DraftTools.py, should handle gracefully this situation.

This isn't a big problem, as if the object isn't created, the tree view will just show a broken icon indicating a problem with that object. However, I think it would be best to test for invalid objects and reject the operation if the wrong input is given. For example, I think both Text and Dimensions are App::FeaturePython objects instead of objects derived from Part::FeaturePython, so maybe we can test the former and reject it as input.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply