@@ -53,6 +53,15 @@ def get_project_subroot(view):
53
53
sub_root_setting = project_data .get ('root' , "" )
54
54
return sub_root_setting
55
55
56
+ def get_project_app_path (view ):
57
+ """ Returns a path to a certain Archicad version, if set in the project file.
58
+ (Useful if one is developing for different Archicad versions and
59
+ they want to use the appropiate LP Converter version.)
60
+ """
61
+ project_data = view .window ().project_data ()
62
+ app_path = project_data .get ('AC_path' , "" )
63
+ return app_path
64
+
56
65
def err (text ):
57
66
""" Gives us a ST error message. """
58
67
if text == None :
@@ -107,12 +116,19 @@ def on_post_save_async(self, view):
107
116
############################################################################
108
117
class Builder (sublime_plugin .WindowCommand ):
109
118
def run (self , * args , ** kwargs ):
110
- self .lp_conv_path = self .check_system ()
119
+ self .view = self .window . active_view ()
111
120
self .pckg_settings = sublime .load_settings (PACKAGE_SETTINGS )
112
- self .AC_path = str (self .pckg_settings .get ("AC_path" , DEFAULT_AC_PATH ))
121
+
122
+ # get the path to the LP_XML_Converter right
123
+ project_app_path = get_project_app_path (self .view )
124
+ if project_app_path == None :
125
+ self .AC_path = str (self .pckg_settings .get ("AC_path" , DEFAULT_AC_PATH ))
126
+ else :
127
+ self .AC_path = project_app_path
128
+
129
+ self .lp_conv_path = self .check_system ()
113
130
self .converter = os .path .join (self .AC_path , self .lp_conv_path )
114
131
115
- self .view = self .window .active_view ()
116
132
if self .view .settings ().get ("auto_save" , True ):
117
133
save_all_files ()
118
134
0 commit comments