In Part workbench: in the menu: Part->Attachment...
Capabilities:
• editing attachment of PartDesign Datum cs, planes, lines and points
• editing attachment of Sketches, PartDesign gears, Draft primitives, and other Part2DObjects. More attachable objects coming soon.
• editing attachment of any object that has Placement property, except that attachment won't be stored (can be useful for alignment).
Feature: General purpose attachment editor
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Feature: General purpose attachment editor
Creating Py attachable objects - 2 essential pieces:
1. App.ActiveDocument.addObject("Part::AttachableObjectPython", "myfeature"). AttachableObjectPython inherits Part::FeaturePython.
2. in Proxy.execute(self, doc_obj): make sure to call doc_obj.positionBySupport(). If your feature's geometry doesn't depend on placement of itself, it's best to call positionBySupport after setting Shape. Otherwise, call before, since positionBySupport updates Placement.
positionBySupport returns Boolean. True means the attachment is active; false - inactive; if attachment fails with an error - positionBySupport raises exception.
1. App.ActiveDocument.addObject("Part::AttachableObjectPython", "myfeature"). AttachableObjectPython inherits Part::FeaturePython.
2. in Proxy.execute(self, doc_obj): make sure to call doc_obj.positionBySupport(). If your feature's geometry doesn't depend on placement of itself, it's best to call positionBySupport after setting Shape. Otherwise, call before, since positionBySupport updates Placement.
positionBySupport returns Boolean. True means the attachment is active; false - inactive; if attachment fails with an error - positionBySupport raises exception.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Feature: General purpose attachment editor
since 0.17.8576:
Object being attached is temporarily made semi-transparent in rendering, and transparent to clicks (unpickable).
Object being attached is temporarily made semi-transparent in rendering, and transparent to clicks (unpickable).
Re: Feature: General purpose attachment editor
This is working good.DeepSOIC wrote:since 0.17.8576:
Object being attached is temporarily made semi-transparent in rendering, and transparent to clicks (unpickable).
As for the rest i managed to attach Draft Circle on top face of Cylinder and the same Cylinder on top face of Box. Moving the Box moves the Cylinder and Circle along with it. I added additional Box and tested the same with selecting one face on each Box and after FreeCAD restart attached Box doesn't move with the rest (Box, Cylinder and Draft Circle). But if i select the Box and start attachment editor the Box moves to the expected position. I like the fact only available options are provided and the rest is disabled but the complexity of the tool will likely contribute to some users simply not using it. This tool likely could be turned into a toolbar of tools in the future. The amount of messages (yellow/red) in Report view is overwhelming.
P.S. And i guess the tool itself is influenced a bit by Assembly capabilities currently lacking in FreeCAD and therefore try out Assembly2 ASAP as you will likely feel just like at home over there.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Feature: General purpose attachment editor
This isn't a good bug report. But I managed to reproduce it. in short, attach a Part Cube to something, move something -> cube doesn't move.triplus wrote:I added additional Box and tested the same with selecting one face on each Box and after FreeCAD restart attached Box doesn't move with the rest (Box, Cylinder and Draft Circle).
EDIT:
created issue #0002722
Re: Feature: General purpose attachment editor
Well yeah. If the tool would be more simple the bug report would likely be more like that.DeepSOIC wrote:This isn't a good bug report.
Yes.DeepSOIC wrote:in short, attach a Part Cube to something, move something -> cube doesn't move.