Spaces:
Sleeping
Sleeping
do not convert if not in revit id format
Browse files
app.py
CHANGED
@@ -27,6 +27,10 @@ def compress(g):
|
|
27 |
|
28 |
def revit_id_to_guid(sheet, column):
|
29 |
|
|
|
|
|
|
|
|
|
30 |
id_components = sheet[column].rsplit('-', 1)
|
31 |
episode_id = id_components[0]
|
32 |
element_id = id_components[1]
|
@@ -133,7 +137,7 @@ st.markdown(
|
|
133 |
'''
|
134 |
# Convert Revit IDs to GUIDs
|
135 |
|
136 |
-
Provide any spreadsheet (using a dropbox link) that has a column of revit IDs.
|
137 |
|
138 |
|
139 |
Select the sheet witin the spreadsheet and the column with the IDs.
|
@@ -169,12 +173,12 @@ if tabs:
|
|
169 |
)
|
170 |
|
171 |
if selected_sheet:
|
172 |
-
|
173 |
df = cobie_file.parse(selected_sheet)
|
174 |
|
175 |
if type(df) == pd.DataFrame:
|
176 |
|
177 |
-
st.write(df)
|
178 |
columns = df.columns
|
179 |
selected_column = st.selectbox(
|
180 |
'Select column with revit ids',
|
|
|
27 |
|
28 |
def revit_id_to_guid(sheet, column):
|
29 |
|
30 |
+
if not '-' in sheet[column]:
|
31 |
+
|
32 |
+
return sheet[column]
|
33 |
+
|
34 |
id_components = sheet[column].rsplit('-', 1)
|
35 |
episode_id = id_components[0]
|
36 |
element_id = id_components[1]
|
|
|
137 |
'''
|
138 |
# Convert Revit IDs to GUIDs
|
139 |
|
140 |
+
Provide any spreadsheet (using a dropbox link) that has a column of revit IDs. A typical Revit IDS is `60f91daf-3dd7-4283-a86d-24137b73f3da-0001fd0b`. The script will convert the ID to '3CPy6r22DAahSW8AIIobik'.
|
141 |
|
142 |
|
143 |
Select the sheet witin the spreadsheet and the column with the IDs.
|
|
|
173 |
)
|
174 |
|
175 |
if selected_sheet:
|
176 |
+
|
177 |
df = cobie_file.parse(selected_sheet)
|
178 |
|
179 |
if type(df) == pd.DataFrame:
|
180 |
|
181 |
+
# st.write(df)
|
182 |
columns = df.columns
|
183 |
selected_column = st.selectbox(
|
184 |
'Select column with revit ids',
|