Skip to content

A FreeCAD Mod which adds a search bar to the user inferface. The results include tools, document objects and preferences.

License

Notifications You must be signed in to change notification settings

APEbbers/SearchBar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

FreeCAD SearchBar

This FreeCAD mod adds a search bar for tools, document objects and preferences. Each of these types can be included or excluded in the preference menu. When hovered over, tools will also be highlighted in the FreeCAD Interface.
For documents, the thumbnail will be shown by default. However, it is possible to enable a 3D-previewer. Be aware that this can make the add-on less stable, so use at your own risk.

The SearchBar can also be activated as a MouseBar next to the mouse cursor by pressing a shortcut key. By default this is the "S" key but it can be changed.

Usage

The search bar appears next to the What's this? tool drawing in FreeCAD's default File toolbar, or next to the mouse cursor by pressing "S".

Screenshot of the search bar, with results in its drop-down menu and extra info about the result in a separate pane

When using the search bar for the first time, it will contain only the tools of the workbenches which have already been loaded in FreeCAD. To include results from other workbenches, select the first search result "Refresh cached results" which will load all FreeCAD workbenches and memorize their tools. After restarting FreeCAD, the search result will include the memorized tools, even if the workbenches have not been loaded yet. When selecting a tool from the search results, SearchBar will attempt to automatically load the workbenches which could have provided that tool.

Animation showing how to initially load all workbenches using the first entry in the search bar

To navigate the search results, use the up and down arrows. Typing characters will filter the results on the fly. The extended information panel next to the search results provides further documentation about the results, e.g. Python snippets which can be copy-pasted.

Animation showing how to navigate the search results with the up and down keys and select code examples from the results

Installation

Automatic Install

Install SearchBar addon via the FreeCAD Addon Manager from the Tools ➡️ Addon Manager dropdown menu.

Manual Install

Expand for instructions on manual installation of SearchBar

Clone the GIT repository or extract the .zip downloaded from GitHub to the following location:

  • Linux: ~/.FreeCAD/Mod/SearchBar
  • macOS: /Users/user_name/Library/Preferences/FreeCAD/Mod/SearchBar
  • Windows: C:\Users\user_name\AppData\Roaming\FreeCAD\Mod\SearchBar

Uninstallation

  • Remove the folder which was cloned during installation:
    • Linux: ~/.FreeCAD/Mod/SearchBar
    • macOS: /Users/user_name/Library/Preferences/FreeCAD/Mod/SearchBar
    • Windows: C:\Users\user_name\AppData\Roaming\FreeCAD\Mod\SearchBar
  • Optional: Remove the cache (~30MB) \~/.FreeCAD/Cache_SearchBarMod or equivalent on other platforms

Extensibility

This addon can be extended by adding a new result provider. This can be done by importing the module SearchResults and calling the registration functions. See the file SearchResults.py for explanation and examples.

Development

Development is done under the branch "Develop". With the latest version of the Addom-Manager, you can switch to this branch if you like to test new features.

  • InitGui.py adds an instance of SearchBoxLight to the GUI.
  • SearchBoxLight is a hollowed-out implementation of a search box, it loads everything lazily.
  • SearchResults.pyis used to extend type of results for this add-on.

Note:

⚠️ Several issues related to the C++ memory management interacting badly with Python's have caused lots of segfaults during development. ⚠️

⚠️️ Most of these should now be solved, but save your work often and proceed with caution while testing this extension. ⚠️

Feedback

To report bugs or feature enhancements, please open a ticket in the issue queue. Best place to discuss feedback or issues in on the dedicated FreeCAD forum discussion for SearchBar.

License License: CC0 v1.0.

See LICENSE. This repository is in the public domain.

About

A FreeCAD Mod which adds a search bar to the user inferface. The results include tools, document objects and preferences.

Resources

License

Stars

Watchers

Forks

Languages

  • Python 99.9%
  • Other 0.1%