@@ -40,16 +40,11 @@ def parameter_exists(parameter_name):
40
40
41
41
if not parameter_exists (DOORDIR_WRITEBACK_PARAM ):
42
42
print (
43
- "The parameter '{}' does not exist in the current document." . format (
44
- DOORDIR_WRITEBACK_PARAM
45
- )
43
+ "The parameter '{}' does not exist in the current document.\n "
44
+ "Please create the parameter as an instance parameter, option different values for groupes, \n "
45
+ "for the category doors in the project." . format ( DOORDIR_WRITEBACK_PARAM )
46
46
)
47
- print (
48
- "Please create the parameter as an instance parameter, option different values for groupes,"
49
- )
50
- print ("for the category doors in the project." )
51
-
52
- sys .exit ()
47
+ script .exit ()
53
48
54
49
count_parameter = 0
55
50
count_not_parameter = 0
@@ -95,46 +90,34 @@ def parameter_exists(parameter_name):
95
90
)
96
91
door_out_param .Set (str (value ))
97
92
except AttributeError :
98
- print (
93
+ forms . alert (
99
94
"Please make sure instance parameter exists: {}" .format (
100
95
DOORDIR_WRITEBACK_PARAM
101
96
)
102
97
)
98
+ script .exit ()
103
99
104
100
output .print_md (
105
- "### Number of doors found in the project: {} " .format (len (doors_collector ))
106
- )
107
- output .print_md (
108
- "of these with writeback parameters defined in door family: {}" .format (
109
- count_parameter
110
- )
111
- )
112
- output .print_md (
113
- "without writeback parameters defined in door family: {a}" .format (
114
- a = count_not_parameter ,
101
+ "### Number of doors found in the project: {} \n "
102
+ "- With writeback parameters defined in door family: {}\n "
103
+ "- Without writeback parameters defined in door family: {}\n "
104
+ "- Parameters missing: '{}', '{}'\n "
105
+ "- You will find in the folder of the script a shared parameter file containing these parameters.\n "
106
+ "- The default writeback value for doors without defined values will be: '{}'\n "
107
+ "---\n " .format (
108
+ len (doors_collector ),
109
+ count_parameter ,
110
+ count_not_parameter ,
111
+ DOORDIR_STANDARD_PARAM ,
112
+ DOORDIR_MIRRORED_PARAM ,
113
+ DOORDIR_ERROR_VALUE ,
115
114
)
116
115
)
117
- output .print_md (
118
- "parameters missing: "
119
- "'{b}'"
120
- ", "
121
- "'{c}'"
122
- "" .format (b = DOORDIR_STANDARD_PARAM , c = DOORDIR_MIRRORED_PARAM )
123
- )
124
- output .print_md (
125
- "you will find in the folder of the script a shared parameter file containing this parameters."
126
- )
127
- output .print_md (
128
- "The default writeback value for doors without defined values will be : "
129
- " {d} "
130
- " " .format (d = DOORDIR_ERROR_VALUE )
131
- )
132
- output .print_md ("---" )
116
+
133
117
output .print_md ("### Door families without writeback parameter defined in family:" )
134
118
for door_type in doors_without_parameter :
135
119
print (door_type )
136
- output .print_md ("---" )
137
- output .print_md ("### Changes to previous run of the script:" )
120
+ output .print_md ("---\n ### Changes to previous run of the script:" )
138
121
139
122
if data_doors_changed :
140
123
output .print_table (
@@ -145,6 +128,5 @@ def parameter_exists(parameter_name):
145
128
else :
146
129
output .print_md ("#### No doors with changed parameters were found." )
147
130
148
- output .print_md ("---" )
149
131
elapsed_time = time .time () - timer_start
150
- output .print_md ("#### Script has finished in {:.2f}s" .format (elapsed_time ))
132
+ output .print_md ("--- \n #### Script has finished in {:.2f}s" .format (elapsed_time ))
0 commit comments