Macro Copy3DViewToClipboard: Difference between revisions

From FreeCAD Documentation
No edit summary
(Vertical {{Macro}}; fixed icon)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{Macro
{{Macro|Icon=Macro_Copy3DViewToClipboard|Name=Macro Copy3DViewToClipboard|Description=Copy contents of 3DView to clipboard|Author=Mario52|Version=00.01|Date=2016-09-14}}
|Name=Macro Copy3DViewToClipboard
|Description=Copy contents of 3DView to clipboard
|Author=Mario52
|Version=00.01
|Date=2016-09-14
}}


==Description== <!--T:2-->
==Description== <!--T:2-->

Revision as of 18:33, 3 December 2018

Other languages:

Macro Copy3DViewToClipboard

Description
Copy contents of 3DView to clipboard

Macro version: 00.01
Last modified: 2016-09-14
Author: Mario52
Author
Mario52
Download
None
Links
Macro Version
00.01
Date last modified
2016-09-14
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Description

Macro will copy the contents of the 3D view to the clipboard

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