OpenSCAD Replace Object in feature tree

Post here for help on using FreeCAD's graphical user interface (GUI).
User avatar
Maavhamt
Posts: 84
Joined: Thu Jun 11, 2015 10:08 am

OpenSCAD Replace Object in feature tree

Postby Maavhamt » Wed Jan 11, 2017 2:24 pm

Dear All,

In OpenSCAD I use the "Removes the selcted object and all children" icon a lot and find it useful. But I can't make out the other icon "Replace an object in the feature tree". On the face of it it sounds useful as well but I can't make it work. The Help on it is not complete. Can anyone give me some advice?

Capture.GIF
Capture.GIF (17.71 KiB) Viewed 149 times


OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: 2ce5c8d2e3020d05005ed71f710e09e9aa561f40
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Maavhamt
User avatar
NormandC
Posts: 12077
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: OpenSCAD Replace Object in feature tree

Postby NormandC » Thu Jan 12, 2017 5:17 am

Hi,

The tooltip says it all:
Replace an object in the Feature Tree, Please select old, new and parent object

Old = object to be replaced
New = object replacement
Parent = the object that holds the object to be replaced.

A simple example of use is a Fusion of a cube, a cylinder and a sphere.

Say you want to replace the sphere by a torus. So you first select the sphere, then the torus, and finally the Fusion; then you click on the tool.

This is a tool from the OpenSCAD workbench, and OpenSCAD uses a CSG methodology. I doubt this tool was intended to work for anything but Part Booleans. But it may work with other object types that can hold at least one object. You may be able to replace a sketch under a Part Loft or Sweep, but I've never tried it.

Maavhamt wrote:OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)

Your version is outdated, a few bug fix releases have been published since. The latest for Windows is 0.16.6706.
User avatar
NormandC
Posts: 12077
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: OpenSCAD Replace Object in feature tree

Postby NormandC » Thu Jan 12, 2017 5:23 am

NormandC wrote:But it may work with other object types that can hold at least one object.

Tested on a sketch under a PartDesign Pad: it works. :)
DeepSOIC
Posts: 4504
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: OpenSCAD Replace Object in feature tree

Postby DeepSOIC » Thu Jan 12, 2017 12:34 pm

I had trouble when I used this tool with Body containers. I think I attempted to transfer something from one body to another. Or something like that. At the moment I was too busy with completing the project, so I didn't bother investigating the problem, and just went to Py console to do what I wanted...
User avatar
NormandC
Posts: 12077
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: OpenSCAD Replace Object in feature tree

Postby NormandC » Sat Jan 14, 2017 6:13 pm

Considering bodies are still pretty new objects that respond to a new set of rules, I guess this was to be expected. Once PartDesignNext is stabilized, it may be useful to check if the Replace Object tool could be improved to work with the new PDN stuff...