FreeCAD Logo FreeCAD 1.0
  • angielski afrykanerski arabski białoruski kataloński czeski niemiecki grecki hiszpański hiszpański baskijski fiński filipiński francuski galicyjski chorwacki węgierski Indonezyjski włoski japoński kabylski koreański litewski duński Norweski Bokmal polski portugalski portugalski rumuński rosyjski słowacki słoweński serbski szwedzki turecki ukraiński walenciański wietnamski chiński chiński
  • Funkcjonalność programu
  • Pobierz
  • Blog
  • Dokumentacja
    Spis dokumentacji Jak zacząć Dokumentacja użytkowników Podręcznik do programu FreeCAD Dokumentacja środowisk pracy Dokumentacja skryptów środowiska Python Dokumentacja kodowania C++ Poradniki Najczęściej zadawane pytania Polityka prywatności O FreeCAD
  • Przyłącz się do projektu
    Jak pomóc Sponsor Zgłoś błąd Utwórz pull request Praca i finansowanie Zasady współpracy Podręcznik dla programistów Tłumaczenia
  • Społeczność
    Kodeks postępowania Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Kalendarz
  • ♥ Donate

Donate

$
Informacje o SEPA
Skonfiguruj przelew bankowy SEPA do:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank: BNP Paribas Fortis
Adres: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Visibility_Manager

Opis
Użyj tego do zarządzania widocznością obiektów w dokumencie.
Są dwa tryby działania: Pokaż wszystko oraz Pokaż typy.

W trybie Pokaż typy (domyślnym) wyświetlana jest lista typów obiektów, np. Zawartość, Szkic, Wyciągnięcie.
Przełączanie widoczności konkretnego typu włącza lub wyłącza widoczność wszystkich obiektów tego typu w aktywnym dokumencie.
W trybie Pokaż wszystko (wciśnij klawisz Shift podczas uruchamiania makra) widoczna jest osobna lista z polem do zaznaczania dla każdego obiektu w dokumencie, posortowana alfabetycznie.
Możesz indywidualnie włączać lub wyłączać widoczność każdego obiektu.

Macro version: 1.06
Last modified: 2020-06-18
FreeCAD version: All
Download: Ikona paska narzędzi
Autor: TheMarkster

Autor
TheMarkster
Do pobrania
Ikona paska narzędzi
Odnośniki
Przepisy na makropolecenia
Jak zainstalować makrodefinicje
Dostosowanie pasków narzędzi
Wersja Makrodefinicji
1.06
Data zmian
2020-06-18
Wersja FreeCAD
All
Domyślny skrót
Brak
Zobacz również
-

Opis

Użyj tego makra do zarządzania widocznością obiektów dokumentu po typie lub indywidualnie.

Skrypt

Ikona paska narzędzi

Macro_Visibility_Manager.FCMacro

# -*- coding: utf-8 -*-
"""
***************************************************************************
*   Copyright (c) 2019 <TheMarkster>                                 *
*                                                                         *
*   This file is a supplement to the FreeCAD CAx development system.      *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License (LGPL)    *
*   as published by the Free Software Foundation; either version 2 of     *
*   the License, or (at your option) any later version.                   *
*                                                                         *
*   This software is distributed in the hope that it will be useful,      *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU Library General Public License at http://www.gnu.org/licenses     *
*   for more details.                                                     *
*                                                                         *
*   For more information about the GNU Library General Public License     *
*   write to the Free Software Foundation, Inc., 59 Temple Place,         *
*   Suite 330, Boston, MA  02111-1307 USA                                 *
*                                                                         *
***************************************************************************
"""

"""
Visibility_Manager Macro

Use this to manage the visibility of document objects.

There are 2 modes of operation: Show All and Show Types.

In Show Types mode (the default) you only see a list of the types
of objects, e.g. Body, Sketch, Pad, Extrude.

Toggling one of the types off/on will set the visibility of all document
objects of that type in the active document.

In Show All mode (Press Shift key while executing the macro) you see 
a different checkbox for each and every document object, sorted
alphabetically.  You can toggle each object's visibility individually.

"""

__title__ = "Visibility_Manager"
__author__ = "TheMarkster"
__url__ = ""
__Wiki__ = "https://wiki.freecad.org/Macro_Visibility_Manager"
__date__ = "2020.06.18"
__version__ = 1.06

import FreeCAD
from PySide import QtCore, QtGui
import time

class Dlg(QtGui.QDialog):
    def __init__(self, bShowAll=False):
        QtGui.QDialog.__init__(self)
        self.types={} #dict of types
        self.showAll = bShowAll
        self.reload = False
        self.infoLabel = QtGui.QLabel()
        self.infoLabel.mousePressEvent = self.label_clicked
        if self.showAll:
            self.infoLabel.setText("Show All mode")
        else:
            self.infoLabel.setText("Show by Type mode")
        checkboxLayout = QtGui.QVBoxLayout()
        self.checkboxes = []
        widget = QtGui.QWidget() #will hold scroll area
        checkboxLayout = QtGui.QVBoxLayout()
        self.addCheckboxes(checkboxLayout)  
        widget.setLayout(checkboxLayout)

        #Scroll Area Properties
        scroll = QtGui.QScrollArea()
        scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        scroll.setWidgetResizable(True)
        scroll.setWidget(widget)
        vLayout = QtGui.QVBoxLayout()
        vLayout.addWidget(scroll)

        #buttons = QtGui.QDialogButtonBox(
        #    QtGui.QDialogButtonBox.Ok.__or__(QtGui.QDialogButtonBox.Cancel),
        #    QtCore.Qt.Horizontal, self)
        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok, QtCore.Qt.Horizontal,self)
        buttons.addButton(QtGui.QDialogButtonBox.Cancel)
        mode_button = buttons.addButton('Switch Mode', QtGui.QDialogButtonBox.ActionRole)
        mode_button.clicked.connect(self.label_clicked)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        buttons.setCenterButtons(True)
        layout = QtGui.QVBoxLayout()
        layout.addWidget(self.infoLabel)
        layout.addLayout(vLayout)
        layout.addWidget(buttons)
        self.setLayout(layout)

    def label_clicked(self, event):
        self.reload = True
        self.close()
        QtGui.QApplication.processEvents()
        time.sleep(0.1)

    def addCheckboxes (self, cbLayout):
        objectList = FreeCAD.ActiveDocument.findObjects()
        objectList.sort(key=lambda x: x.Name, reverse=False)
        nameList = []
        for obj in objectList:
            if not self.nameInList(obj.Name, nameList):
                nameList.append(obj.Name)
                self.newType(obj.Name)

        all = QtGui.QCheckBox("All", self)
        all.setObjectName("all")
        all.toggled.connect(self.allToggled)
        cbLayout.addWidget(all)
        self.checkboxes = [all]
        for name in nameList:
            for nn in range(0,len(self.types[name])):
                objLabel = getattr(FreeCAD.ActiveDocument,self.types[name][nn]).Label
                objName = self.types[name][nn]
                if objLabel != objName and self.showAll:
                    ck = QtGui.QCheckBox(self.types[name][nn]+" ("+objLabel+")", self)
                else:
                    ck = QtGui.QCheckBox(objName,self)
                ck.setObjectName(objName)

                if getattr(FreeCAD.ActiveDocument,self.types[name][nn]).ViewObject.Visibility:
                    ck.setCheckState(QtCore.Qt.Checked)
                else:
                    ck.setCheckState(QtCore.Qt.Unchecked)
                if nn != 0 and not self.showAll:
                    ck.hide()
                cbLayout.addWidget(ck)
                self.checkboxes.append(ck)
    
    def addToTypes(self, typeName, name):
        self.types[typeName].append(name)

    def newType(self, typeName):
        self.types[typeName] = [typeName]
    
    def nameInList(self, name, nameList):
        """ check if name is in nameList
            e.g. name = "Extrude002"
            nameList = ["Extrude", "Extrude001", "Extrude002"...]
        """
        for nl in nameList:
            if nl in name and nl[:3] == name[:3]:
                self.addToTypes(nl,name)
                return True
        return False

    def allToggled(self):
        """all checkbox was toggled"""
        allState = self.checkboxes[0].checkState()
        for ii in range(1,len(self.checkboxes)):
            self.checkboxes[ii].setCheckState(allState)

    def accept(self):
        """user clicked Ok"""
        self.setWindowOpacity(0.85)
        self.infoLabel.setText("Working...")
        if self.showAll:
            for ii in range(1, len(self.checkboxes)):
                name = self.checkboxes[ii].objectName()
                state = self.checkboxes[ii].checkState()
            
                if state == QtCore.Qt.Checked:
                    obj = getattr(FreeCAD.ActiveDocument, name)
                    if not obj.ViewObject.Visibility:
                        obj.ViewObject.Visibility = True
                else:
                    obj = getattr(FreeCAD.ActiveDocument, name)
                    if obj.ViewObject.Visibility:
                        obj.ViewObject.Visibility = False
                QtGui.QApplication.processEvents()
                time.sleep(0.01)
        else: #show type mode
            for ii in range(1, len(self.checkboxes)):
                if not self.checkboxes[ii].isVisible():
                    continue
                name = self.checkboxes[ii].objectName()
                state = self.checkboxes[ii].checkState()
            
                if state == QtCore.Qt.Checked:
                    for n in self.types[name]:
                        obj = getattr(FreeCAD.ActiveDocument, n)
                        obj.ViewObject.Visibility = True
                else:
                    for n in self.types[name]:
                        obj = getattr(FreeCAD.ActiveDocument, n)
                        obj.ViewObject.Visibility = False
                QtGui.QApplication.processEvents()
                time.sleep(0.01)
        self.close()


showAll = False
modifiers = QtGui.QApplication.keyboardModifiers()
if modifiers == QtCore.Qt.ShiftModifier:
    showAll = True
if FreeCAD.ActiveDocument:
    dlg = Dlg(showAll)
    dlg.setWindowTitle("Visibility Manager v"+str(__version__))
    result = dlg.exec_()
    while dlg.reload:
        showAll = not dlg.showAll
        dlg = Dlg(showAll)
        dlg.setWindowTitle("Visibility Manager v"+str(__version__))
        result = dlg.exec_()
else:
    FreeCAD.Console.PrintWarning("Visibility Manager v"+str(__version__)+": no active document\n")

Ta strona pochodzi z https://wiki.freecad.org/Macro_Visibility_Manager

Bądźmy w kontakcie!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© Załoga FreeCAD. Autorami grafiki na stronie głównej (od góry do dołu) są: ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

Ten projekt jest wspierany przez: , KiCad Services Corp. oraz pozostałych sponsorów

GitHubUlepsz tę stronę na GitHub