Macro Copy3DViewToClipboard

From FreeCAD Documentation
Revision as of 12:27, 25 July 2019 by Mario52 (talk | contribs) (description)
Other languages:

Macro Copy3DViewToClipboard

Description
Macro will copy the contents of the 3D view to the clipboard in image bitmap (BMP).
The copy in Gimp is not possible Gimp use his model in memory.

Macro version: 00.01
Last modified: 2016-09-14
FreeCAD version: <=0.17
Download: ToolBar Icon
Author: Mario52
Author
Mario52
Download
ToolBar Icon
Links
Macro Version
00.01
Date last modified
2016-09-14
FreeCAD Version(s)
<=0.17
Default shortcut
G Q
See also
None

Description

Macro will copy the contents of the 3D view to the clipboard in image bitmap (BMP). The copy in Gimp is not possible Gimp use his model in memory.

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.githubusercontent.com/mario52a/f5c3738f858f7b058897c6c235232cbe/raw/a10bc3b8789badc1e405541d4697d7286d9f0fd3/Macro_Copy3DViewToClipboard.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.githubusercontent.com/mario52a/f5c3738f858f7b058897c6c235232cbe/raw/a10bc3b8789badc1e405541d4697d7286d9f0fd3/Macro_Copy3DViewToClipboard.FCMacro")


How To Use

  • Run once to activate macro (the macro is loaded resident into the memory of the PC).
  • Press G to grab the contents of the 3d view and copy them to the clipboard.
  • Press Q to quit.

PS: if you wild other format modify the values of the line number 33 ex:

glw.resize(640, 480)                                    # reduce the SubWindow

to

glw.resize(800, 600)                                    # reduce the SubWindow

Discussion

See forum-thread here.

Code

The icon for you toolbar

Copy the macro to Gist Macro_Copy3DViewToClipboard.FCMacro