-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vectronic/dev
feat: added macro to add technic pin to existing body
- Loading branch information
Showing
6 changed files
with
485 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# coding: UTF-8 | ||
|
||
import sys | ||
import os.path | ||
|
||
# get the path of the current python script | ||
current_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# check if this path belongs to the PYTHONPATH variable and if not add it | ||
if not sys.path.__contains__(str(current_path)): | ||
sys.path.append(str(current_path)) | ||
|
||
from FreeCAD import Console, Gui, activeDocument | ||
from PySide2.QtWidgets import QMessageBox | ||
from PySide2.QtCore import Qt | ||
from Legify.Common import * | ||
|
||
if not Gui.activeDocument(): | ||
|
||
Console.PrintMessage("No active document!\n") | ||
dialog = QMessageBox(QMessageBox.Warning, 'No active document!', "There is no active document!") | ||
dialog.setWindowModality(Qt.ApplicationModal) | ||
dialog.exec_() | ||
|
||
exit(1) | ||
|
||
selection = Gui.Selection.getSelection() | ||
|
||
if not selection[0]: | ||
|
||
Console.PrintMessage("No selected body!\n") | ||
dialog = QMessageBox(QMessageBox.Warning, 'No selected body!', "There is no selected body!") | ||
dialog.setWindowModality(Qt.ApplicationModal) | ||
dialog.exec_() | ||
|
||
exit(1) | ||
|
||
if not selection[1]: | ||
Console.PrintMessage("No selected datum line!\n") | ||
dialog = QMessageBox(QMessageBox.Warning, 'No selected datum line!', "There is no selected datum line!") | ||
dialog.setWindowModality(Qt.ApplicationModal) | ||
dialog.exec_() | ||
|
||
exit(1) | ||
|
||
render_pin('Pin', selection[1], selection[0], activeDocument()) | ||
|
||
Gui.activeDocument().activeView().viewAxonometric() | ||
Gui.SendMsgToActiveView("ViewFit") |