Add a preference for particular app to open sheet layout

This commit is contained in:
Ryan Schultz
2023-10-15 20:04:53 -05:00
parent c48c1c3b32
commit 6e9639446d
3 changed files with 8 additions and 1 deletions
+3
View File
@@ -132,6 +132,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
description='E.g. [["inkscape", "svg", "-o", "eps"], ["pstoedit", "-dt", "-f", "dxf:-polyaslines -mm", "eps", "dxf", "-psarg", "-dNOSAFER"]]',
)
svg_command: StringProperty(name="SVG Command", description='E.g. [["firefox", "path"]]')
layout_svg_command: StringProperty(name="Layout SVG Command", description='E.g. [["firefox", "path"]]')
pdf_command: StringProperty(name="PDF Command", description='E.g. [["firefox", "path"]]')
spreadsheet_command: StringProperty(name="Spreadsheet Command", description='E.g. [["libreoffice", "path"]]')
openlca_port: IntProperty(name="OpenLCA IPC Port", default=8080)
@@ -205,6 +206,8 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
row = layout.row()
row.prop(self, "svg_command")
row = layout.row()
row.prop(self, "layout_svg_command")
row = layout.row()
row.prop(self, "pdf_command")
row = layout.row()
row.prop(self, "spreadsheet_command")
+1 -1
View File
@@ -90,7 +90,7 @@ def add_sheet(ifc, drawing, titleblock=None):
def open_sheet(drawing, sheet=None):
drawing.open_svg(drawing.get_document_uri(sheet, "LAYOUT"))
drawing.open_layout_svg(drawing.get_document_uri(sheet, "LAYOUT"))
def remove_sheet(ifc, drawing, sheet=None):
@@ -848,6 +848,10 @@ class Drawing(blenderbim.core.tool.Drawing):
def open_svg(cls, uri):
cls.open_with_user_command(bpy.context.preferences.addons["blenderbim"].preferences.svg_command, uri)
@classmethod
def open_layout_svg(cls, uri):
cls.open_with_user_command(bpy.context.preferences.addons["blenderbim"].preferences.layout_svg_command, uri)
@classmethod
def run_root_assign_class(
cls,