Macro Editor Assistant

From FreeCAD Documentation
Revision as of 22:59, 14 October 2023 by TheMarkster (talk | contribs) (fix link to 1.96 on gist.github.com)
Other languages:

Macro Editor Assistant

Description
Extend functionality of FreeCAD's integrated Python editor

Macro version: 1.96
Last modified: 2023-09-28
FreeCAD version: 0.21 or later
Download: ToolBar Icon
Author: TheMarkster
Author
TheMarkster
Download
ToolBar Icon
Links
Macro Version
1.96
Date last modified
2023-09-28
FreeCAD Version(s)
0.21 or later
Default shortcut
None
See also

Description

The Editor Assistant extends the capabilities of FreeCAD's integrated Python editor. The editor is quite good at what it does, but is somewhat limited in features. This macro attempts to supplement the editor by adding some of these missing features, including: search and replace, bookmarks, help references, snapshots, diffs, find highlighting, snippet text insertion via a templates mechanism, and more.

Usage

Install and run the macro. A new dialog will appear as a third tab in the Combo view. As a third tab dialog it will not interfere with other task dialogs needing to use the Task tab for their dialogs. (If preferred, you can launch the macro as a dockable floating window by holding the Alt key while executing the macro.)

The macro will feature a list widget showing all the currently open editors. The editor selected will be the current editor to which the macro functions will be applied. When you select an editor from the list widget that editor is given the focus. (But selecting a new editor in the MDI area tab widget does not make it the current editor.) From time to time as new windows are opened and others are closed you will need refresh the list widget by pressing the Refresh button.

Full documentation can be found on GitHub: Editor Assistant.

Macro Editor Assistant screenshot‎

Legend

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.github.com/mwganson/20475dad57d9b659190f082d20e3bde6/raw/c1cc5b4ff24ffa1ec04d2d51db33880eedc9996e/Editor_Assistant.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.github.com/mwganson/20475dad57d9b659190f082d20e3bde6/raw/c1cc5b4ff24ffa1ec04d2d51db33880eedc9996e/Editor_Assistant.FCMacro")


ToolBar Icon

Script

Macro Editor_Assitant.FCMacro