Created
August 13, 2023 08:10
-
-
Save juanpaexpedite/5bce56aebfba9326a3b77112eebf7fc0 to your computer and use it in GitHub Desktop.
Change Font Size in FreeCAD TechDraw Workbench Dimensions
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
# List all objects | |
# -*- coding: utf-8 -*- | |
import FreeCAD,Draft | |
# List all objects of the document | |
doc = FreeCAD.ActiveDocument | |
objs = FreeCAD.ActiveDocument.Objects | |
def clearConsole(): | |
from PySide import QtGui | |
mw=Gui.getMainWindow() | |
c=mw.findChild(QtGui.QPlainTextEdit, "Python console") | |
c.clear() | |
r=mw.findChild(QtGui.QTextEdit, "Report view") | |
r.clear() | |
clearConsole() | |
page_name = "Page" | |
new_font_size = 4.0 | |
techdraw_page = doc.getObject(page_name) | |
if techdraw_page: | |
for obj in techdraw_page.OutList: | |
if obj.TypeId == "TechDraw::DrawViewDimension": | |
oldSize = obj.ViewObject.Fontsize | |
obj.ViewObject.Fontsize = new_font_size | |
else: | |
print("TechDraw page not found.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment