Macro SelectVisible

From FreeCAD Documentation
Jump to: navigation, search
This page is a translated version of the page Macro SelectVisible and the translation is 100% complete.

Other languages:
Deutsch • ‎English • ‎français • ‎italiano

SelectVisible.png Macro SelectVisible

Beschreibung
All visible objects in the tree and only these will be selected.

Versionsmakro : 1.0
Datum der letzten Änderung : 2016-04-08
FreeCAD version : All
Herunterladen : ToolBar Icon
Autor
galou_breizh
Herunterladen
ToolBar Icon
Links
Macro-Version
1.0
Datum der letzten Änderung
2016-04-08
FreeCAD-Version(s)
All
Standardverknüpfung
None
Siehe auch
None


Beschreibung

Alle in der Baumansicht sichtbaren Objekte (und nur diese) werden ausgewählt.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon_Installer.


##This code is copied instead of the original macro code

##to guide the user to the offline 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 extra wiki location

import PySide

from PySide import QtGui ,QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,u"Information",
    "This macro must by downloaded with this link" + "\n"
    " " + "\n"
    "https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/SelectVisible.FCMacro" + "\n"
    " " + "\n"
    "Quit this window for access in the download page" )

diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint)

diag.setWindowModality(QtCore.Qt.ApplicationModal)

diag.exec_()

import webbrowser 

webbrowser.open("https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/SelectVisible.FCMacro")
<class="rawcodeurl"><a href="https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/SelectVisible.FCMacro">raw code</a>


Gebrauch

Kopiere das Makro in den Makro-Ordner und starte es (siehe How to install macros für weitere Details).

Code

Die neueste Version des Makros ist zu finden auf: https://github.com/FreeCAD/FreeCAD-macros/blob/master/Utility/SelectVisible.FCMacro

ToolBar Icon SelectVisible.png

Macro_Select.FCMacro

# FreeCAD Macro SelectVisible

__Name__ = 'Select Visible'
__Comment__ = 'All visible objects in the tree will be selected'
__Web__ = 'http://www.freecadweb.org/wiki/Macro_SelectVisible'
__Wiki__ = 'http://www.freecadweb.org/wiki/Macro_SelectVisible'
__Icon__ = 'SelectVisible.svg'
__Help__ = 'All visible objects in the tree and only these will be selected'
__Author__ = 'galou_breizh'
__Version__ = '1.0'
__Status__ = 'Production'
__Requires__ = ''

import FreeCAD as App
import FreeCADGui as Gui

doc = App.activeDocument()

if not doc:
    App.Console.PrintWarning('SelectVisible: no active document')
else:
    Gui.Selection.clearSelection()
    for o in doc.Objects:
        if o.ViewObject.Visibility:
            Gui.Selection.addSelection(o)