Part-o-magic [New: Selection tools, container duplication]

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic [improved Exporter]

Post by DeepSOIC »

freecad-heini-1 wrote: Fri Apr 06, 2018 2:30 pm My Freecad-files:
FC017_part-o-magic_shapegroup_2.fcstd
FC017_part-o-magic_shapegroup_1.fcstd
1. Merge your two projects.
2. create any number of clones of ShapeGroup. Place them as you need. Do not move ShapeGroup itself.
3. Part Compound the clones.
4. select the compound, and apply Lattice Array From Shape: internal placements
5. Create a shapebinder/ghost of the baseplate object from shapegroup.
6. Select the array of placements, the shapebinder/ghost, and apply Lattice Populate Copies.
7. Part Cut the copies off of the chamfer ...
...
PROFIT :mrgreen:

Now you can move clones, and the cuts should update. You can even add more clones, add them to compound, and you'll have more cuts added automatically.
Attachments
PoM-Lattice instance hack.FCStd
(300.04 KiB) Downloaded 58 times
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Part-o-magic

Post by freecad-heini-1 »

Thank you so much Viktor.
Please can you explain from 4 to 6 a bit more in detail.
Which icons are the right ones for me?

Or this steps as a anim gif?
On Linux I use Peek for to create anim gifs.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic

Post by DeepSOIC »

freecad-heini-1 wrote: Fri Apr 06, 2018 8:05 pm Or this steps as a anim gif?
On Linux I use Peek for to create anim gifs.
OK, I found ScreenToGif, feels okay.
PoM-Lattice instance hack.gif
PoM-Lattice instance hack.gif (986.79 KiB) Viewed 3104 times
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Part-o-magic

Post by freecad-heini-1 »

DeepSOIC wrote: Fri Apr 06, 2018 9:40 pm
freecad-heini-1 wrote: Fri Apr 06, 2018 8:05 pm Or this steps as a anim gif?
On Linux I use Peek for to create anim gifs.
OK, I found ScreenToGif, feels okay.
PoM-Lattice instance hack.gif
Thank you for your help Viktor.

An error appear if I select the group and chose array from shape internal placement:

Code: Select all

Error: 
'App.DocumentObjectGroup' object has no attribute 'Shape'
array_from_shape_internal_placement.gif
array_from_shape_internal_placement.gif (394.84 KiB) Viewed 3088 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic

Post by DeepSOIC »

freecad-heini-1 wrote: Sat Apr 07, 2018 6:06 am An error appear if I select the group and chose array from shape internal placement:
Use Part Compound, not Group. I think I can add support for a group quite easily, btw.
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Part-o-magic

Post by freecad-heini-1 »

DeepSOIC wrote: Sat Apr 07, 2018 9:49 am
freecad-heini-1 wrote: Sat Apr 07, 2018 6:06 am An error appear if I select the group and chose array from shape internal placement:
Use Part Compound, not Group. I think I can add support for a group quite easily, btw.
Thank you very much. Sorry, my fault, group instead of compound ... :oops:

Now I catched it! 8-)
For the flange I used also populate array and it worked.
I exported to step with color and imported it. The result is correct:
pom_test_fh-1_stock-list.png
pom_test_fh-1_stock-list.png (13.51 KiB) Viewed 3049 times
The names are a bit strange for the stock-list, but rename will do the job.
POM_AND_LATTICE_SOLUTION.png
POM_AND_LATTICE_SOLUTION.png (52.21 KiB) Viewed 3047 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic [New tool: Replace Object]

Post by DeepSOIC »

New tools:
* List Usages
* Replace Object

List Usages: select an object, click the tool. A message box will pop up, listing all links to and from the selected object.

Code: Select all

==== Cylinder uses: ====
(nothing)

====Links to Cylinder:====
Fusion.Shapes (Link)
Cut.Base (Link)
Box001.Length (Expression)
Spreadsheet.docDeps (Link)
Spreadsheet.C2 (CellExpression)
Cylinder_Edge0.Object (Link)
Cylinder_Edge0.SubLink (Sublink)
ShapeGroup.Group (Child)
ShapeGroup.Tip (Link)
Replace Object is a replacement for OpenSCAD ReplaceObject, featuring container compatibility, sublink and expression support, and selective replacement GUI.
pom-replace.png
pom-replace.png (123.58 KiB) Viewed 2983 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic [New tool: Replace Object]

Post by DeepSOIC »

New tool!
* X-ray

You select the object that is in your way, and click X-ray. The object goes transparent and lets you select other objects inside.
You click X-ray again (when nothing is selected), to remove x-rays from all objects.
partomagic-xray-screencast.gif
partomagic-xray-screencast.gif (526.49 KiB) Viewed 2908 times
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: Replace Object]

Post by easyw-fc »

DeepSOIC wrote: Fri May 18, 2018 1:03 pm New tool!
* X-ray
X-tremely useful indeed :D
Thx
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Part-o-magic [New tool: X-ray]

Post by easyw-fc »

I'm playing a bit with X-ray tool...
would it be possible to keep the edge/face selected on first click as selected also when X-ray button is clicked?
I would need to select i.e. two edges (what i normally do as 'click' plus a second 'Ctrl'+'click') starting with selecting a first edge, then clicking on X-ray button for making this part untouchable, then 'Ctrl'+clicking on the i.e. second edge of the object under the first clicked one and finally launch my python action on the two selected objects... I mean if I just click on the second object, only one edge would be in count, instead if I 'Ctrl'+ click on the second object, also the first edge would be kept into selection list...
Locked