Profile Operation-What does import button do?

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!
Post Reply
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Profile Operation-What does import button do?

Post by falviani »

Hi all,

I am using:

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.21.29485 (Git)
Build type: Release
Branch: master
Hash: a236ca843fdd6674afb6d7ed1454fbd3b547f5ea
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * FC_TabbedBoxWorkbench
I have a simple question about the profile operation that I've been unable to find an answer to by searching the forums.
Profile_question_6Aug2022.png
Profile_question_6Aug2022.png (21.64 KiB) Viewed 707 times
I have no idea where the material to be imported comes from, nor what is supposed to be imported. Any clarification would be greatly appreciated.

-Frank
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Profile Operation-What does import button do?

Post by Russ4262 »

Evening.
The 'Import' button located in the 'Base Geometry' task panel tab will import the base geometry from the operation displayed in the drop-down combobox to its immediate left.

Russell
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Profile Operation-What does import button do?

Post by falviani »

Hi Russel,

Thanks for the info - there's no documentation anywhere for that feature. :( I need to think about use cases for it.

On a related note - in addition to the import button, and using the 'add' button to include 1 or more selections from the underlying solids, is there any other way to add to the operation's base geometry from python?

Again, thanks,
Frank
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Profile Operation-What does import button do?

Post by Russ4262 »

falviani wrote: Sun Aug 07, 2022 2:37 pm ... is there any other way to add to the operation's base geometry from python?

Again, thanks,
Frank
Evening.
Sure. Use the `FreeCADGui` module in scripts, or reference the `Gui` module in the python console. The example below is used directly in the python console, so `Gui` and `App` are already available. `Shape` is the actual name of a Part object that exists in my file, not to be confused with the `Shape` attribute of Part, Draft, and PartDesign objects, like `Box.Shape` or `Body.Pad.Shape` that contain the actual shape attributes and methods.

Code: Select all

import FreeCAD as App  # Unnecessary in python console
import FreeCADGui as Gui  # Unnecessary in python console

obj = App.ActiveDocument.Shape  # Shape is the actual name of my Part object
Gui.Selection.addSelection(obj, ["Face5", "Edge20"])
The above code will add `Face5` and `Edge20` of my `Shape` object to the current Gui selection. They will be highlighted and visible in the viewport just as manually selected features.

Have a great night.
Russell
Post Reply