ToolBit - new version

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

ToolBit - new version

Post by mlampert »

There's a PR-4294 in the works which will change a few things around toolbits. Other than two major changes it should not cause any trouble, and if you haven't created your own shapes you should only be minimally affected.

What you need to do:
* if you haven't used toolbits so far, no changes for you.
* Files with existing jobs using toolbits get converted on loading - however, if you want to edit the toolbit you will need to set the shape file beforehand to the new version.
* If you used toolbits chances are you were asked to create a "working directory" and FC potentially copied the installed shapes into that. You can leave the directories but you should delete the copied shapes.
* If you intend to create your own shapes please read the README.md in the Tools directory, it should have updated instructions
* if you already have created your own shape files, there's a bug in the sketcher or expression engine that doesn't let you set an expression on a constraint iff that constraint has a name. So in order to convert existing shapes you'll have to remove the names of your shapes constraint, save the sketch, and then edit it again to set the expressions referencing the container bag instead.

What changes:
The toolbit shapes now have a dedicated property object for all attributes called PropertyBag. It's really all it is, an object to hold the attributes of a toolbit shape. Because it's now a dedicated object it can hold any property and is not restricted sketcher constraints. It also simplifies creating shapes and does away with that awkward constraint naming construct - boy that was ugly.

As (way too) many of you have experienced there are some issues with how the new toolbits try to connect the dots on the filesystem. What initially looked like a flexible and good idea turned out to be a fly trap - apologies for that. With this PR a relative path in a Library or a Bit is only searched for in two places, in the corresponding Tools subdirectory of the Library (or Bit) itself, and the FC installation path (aka - the bits and shapes shipped by FC).

Why:
The sketcher constraint naming construct was never meant to go into production. It was a hack at the time to make things work. Having a dedicated object also enables options for supporting user defined custom attributes, bindings to inventory systems, icons, drawings ....

Most of you already had to jump though hoops in order to get obsolete search paths taken out of the system, so hopefully the new search strategy is less error prone, more transparent and not too restrictive.

The ask:
Please test and report back.
Thanks
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: ToolBit - new version

Post by dubstar-04 »

This is amazing! The amount of work you have put into this is just incredible!

I have done some basic testing and noticed the following:


EDIT: You have to type something in to the group dropdown before the Ok button is active

I can't add properties to the propertybag, the OK button is greyed out.
PropBagProp.png
PropBagProp.png (21.06 KiB) Viewed 3026 times
Any ideas.

Thanks,

Dan
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

dubstar-04 wrote: Tue Jan 19, 2021 7:52 am I can't add properties to the propertybag, the OK button is greyed out.
Any ideas.
is it still grayed out if you fill in a "Group" - every property has to be in a "Group" or "Category", the nomenclature seems to be ambiguous.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: ToolBit - new version

Post by dubstar-04 »

I have been playing with the new tools some more and I am having the issue shown in the attached video.

I can't seem to select a working directory for the tool library. I have tried the default tools that ship with FreeCAD and my own tool library.

The only thing that I can do is delete the FreeCAD config and use the default tools, if i try and change it I loose all tools.

Any ideas what could be going on?

Thanks,

Dan
Attachments
ToolWD.webm
(573.17 KiB) Downloaded 97 times
ceandraka
Posts: 32
Joined: Sun Dec 27, 2020 11:24 pm

Re: ToolBit - new version

Post by ceandraka »

I suspect this is the same issue I saw in https://forum.freecadweb.org/viewtopic. ... 15&t=54295. It is apparently a known issue.

If so, you will need to edit the user.cfg file manually to get the library directory to a useable location. Then all works fine.

Chuck
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

ceandraka wrote: Tue Jan 19, 2021 6:44 pm ... It is apparently a known issue....
This is supposed to be the fix for that - let me know if it's still an issue.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

dubstar-04 wrote: Tue Jan 19, 2021 12:55 pm The only thing that I can do is delete the FreeCAD config and use the default tools, if i try and change it I loose all tools.
Can you elaborate on that a bit?

In the video, for a library you have to select an actual library not its working directory.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

I'm starting to understand, after a full rebuild, the library doesn't seem to exist in the file dialog - very annoying.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

mlampert wrote: Tue Jan 19, 2021 7:04 pm
dubstar-04 wrote: Tue Jan 19, 2021 12:55 pm The only thing that I can do is delete the FreeCAD config and use the default tools, if i try and change it I loose all tools.
Can you elaborate on that a bit?

In the video, for a library you have to select an actual library not its working directory.
As it turns out - I was wrong, when you open the Library directory of your tools hierarchy the library loads correctly. However, then the issue from your other thread shows up - will fix that tonight.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: ToolBit - new version

Post by mlampert »

sliptonic found and fixed some issues and the relative path issue should also be fixed.
The PR is updated with those changes, please keep testing.
Post Reply