New icons for different types of objects

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

New icons for different types of objects

Post by vocx »

In pull request #3070 I propose an icon for "line" objects, another icon for "regular" shapes, and another icon for "curved" objects. In addition, I propose an icon for "radius or diameter dimensions". In pull requests #3051 and #3058 an icon for "angular dimensions" was already introduced.

My idea is that when you have many such items in the tree view you can glance at it, and find the object that you want more easily, particularly if you change their name (label).
Draft_tree_icons.png
Draft_tree_icons.png (29.09 KiB) Viewed 1059 times
Most Draft objects are instances of the Part_Part2DObject. This has a default icon but you will probably not see it often because this object is never used by itself. You will only see it if something breaks and the document isn't able to load the objects' view provider classes.

The Part_Part2DObjectPython is the Python version of this object; it is normally used with Proxy classes derived from _DraftObject and _ViewProviderDraft, of which the latter assigns the default Draft icon.

Code: Select all

import Draft
App.ActiveDocument.addObject("Part::Part2DObject")

obj = App.ActiveDocument.addObject("Part::Part2DObjectPython")
Draft._DraftObject(obj)
Draft._ViewProviderDraft(obj.ViewObject)
Separately, in pull request #3060 I converted all existing icons to have 96 dpi pixel density, and to be "Plain SVG" instead of "Inskcape SVG". Inkscape introduces some non-standard tags, so we prefer to have Plain SVGs to avoid any sort of issues, such as the ones reported with TechDraw.
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.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: New icons for different types of objects

Post by carlopav »

Wow, this are the kind of small things that improve usability a lot!
vocx wrote: Mon Feb 17, 2020 4:46 am You will only see it if something breaks and the document isn't able to load the objects' view provider classes.
You will see it also if the preference of using part primitives when available is toggled!
follow my experiments on BIM modelling for architecture design
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: New icons for different types of objects

Post by vocx »

carlopav wrote: Mon Feb 17, 2020 6:56 am ...
You will see it also if the preference of using part primitives when available is toggled!
Mmm... I'm not sure I understand what you mean.
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.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: New icons for different types of objects

Post by carlopav »

nothing important, really: you can use Draft to create directly Part2dShapes (by toggling the option in Draft preferences). Doing so, the Part2dIcon will be displayed.
follow my experiments on BIM modelling for architecture design
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: New icons for different types of objects

Post by vocx »

carlopav wrote: Mon Feb 17, 2020 11:52 am nothing important, really: you can use Draft to create directly Part2dShapes (by toggling the option in Draft preferences). Doing so, the Part2dIcon will be displayed.
"Part2dShapes"? Which is the "Part2dIcon"?

The Draft Preferences have the option of creating "Part Primitives when available". Is this what you mean? How does that relate to the icon of Part_Part2DObject? I'm still lost.

LOL. No offense, but I really want to understand what you mean here. I'm intrigued.
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.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: New icons for different types of objects

Post by carlopav »

Lol.. this was just something stupid... Part icons are shown also if you draw part primitives with draft (it's obvious of course)... Just this
follow my experiments on BIM modelling for architecture design
Post Reply