Makrodefinicja: Wyrównaj ścianę obiektu do widoku

From FreeCAD Documentation
Revision as of 14:38, 11 September 2021 by Kaktus (talk | contribs) (Created page with "{{Macro/pl |Name=Makrodefinicja: Wyrównaj ścianę obiektu do widoku |Icon=Macro_Align_Face_Object_to_View.png |Description=To makro kieruje ścianę obiektu na stronę aktyw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Other languages:
English • ‎français • ‎italiano • ‎polski • ‎русский

Macro Align Face Object to View.png Makrodefinicja: Wyrównaj ścianę obiektu do widoku

Opis
To makro kieruje ścianę obiektu na stronę aktywnego widoku.

Macro version: 0.1
Last modified: 2015-01-16
FreeCAD version: Wszystkie
Download: ToolBar Icon
Autor: Mario52
Autor
Mario52
Do pobrania
ToolBar Icon
Odnosniki
Wersja Makrodefinicji
0.1
Data zmian
2015-01-16
Wersja FreeCAD
Wszystkie
Domyślny skrót
Brak
Zobacz również
FCCamera Makro FCCamera

Description

This macro directs the face of the object on the side of the ActiveView (camera). In the case of the face of a borehole (or internal or cylinder) face drilling facing the screen

Usage

  • Select your object and run the macro
  • Your object will be of the camera

Script

ToolBar Icon Macro Align Face Object to View.png

Macro_Align_Face_Object_to_View.FCMacro

# This macro directs the face of the object on the side of the ActiveView (camera)
# extact FCCamera
# 16/01/2015

__title__="Macro_Align_Face_Object_to_View"
__author__ = "Mario52"

import pivy
from pivy import coin

try:
    v=Gui.Selection.getSelectionEx()[0].SubObjects[0].Surface.Axis    # to Axis
#    v = Gui.Selection.getSelectionEx()[0].SubObjects[0].normalAt(0,0) # normalAt
    r=App.Rotation(App.Vector(0,0,1),v)
    Gui.ActiveDocument.ActiveView.setCameraOrientation(r.Q)
except Exception:
    App.Console.PrintError("Select a face and run the macro"+"\n")

Links

Original macro by wmayer Looking for some helpful GUI-commands