Spaces:
Sleeping
Sleeping
Kamran Zulfiqar
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,38 +1,109 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
#
|
|
|
|
|
|
|
4 |
commands = {
|
5 |
-
"
|
6 |
-
"
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
},
|
9 |
-
"
|
10 |
-
"
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
},
|
13 |
-
"
|
14 |
-
"
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
},
|
17 |
-
"
|
18 |
-
"
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
},
|
21 |
-
"
|
22 |
-
"
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
},
|
25 |
-
"
|
26 |
-
"
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
-
# You can add up to 200 commands here
|
30 |
}
|
31 |
|
32 |
-
#
|
33 |
-
st.set_page_config(page_title="AutoCAD Command Helper", layout="wide")
|
34 |
-
|
35 |
-
# Custom style
|
36 |
st.markdown("""
|
37 |
<style>
|
38 |
.stApp {
|
@@ -74,20 +145,30 @@ st.markdown("""
|
|
74 |
# Title
|
75 |
st.markdown('<div class="title">π AutoCAD Command Explorer</div>', unsafe_allow_html=True)
|
76 |
|
77 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
col1, col2 = st.columns([1, 2])
|
79 |
|
80 |
with col1:
|
81 |
-
|
82 |
-
|
83 |
-
with col2:
|
84 |
-
cmd_data = commands[selected_cmd]
|
85 |
st.markdown(f"""
|
86 |
<div class="desc-box">
|
87 |
<div class="desc-title">π οΈ {selected_cmd}</div>
|
88 |
-
<div class="desc-text">{
|
89 |
<div class="desc-link">
|
90 |
-
|
91 |
</div>
|
92 |
</div>
|
93 |
""", unsafe_allow_html=True)
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Set up the page configuration
|
4 |
+
st.set_page_config(page_title="AutoCAD Command Explorer", layout="wide")
|
5 |
+
|
6 |
+
# Commands categorized by functionality (add as many as necessary)
|
7 |
commands = {
|
8 |
+
"DRAWING": {
|
9 |
+
"3DORBIT": {
|
10 |
+
"description": "Rotates the view in 3D space around a pivot point.",
|
11 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-3DORBIT"
|
12 |
+
},
|
13 |
+
"LINE": {
|
14 |
+
"description": "Creates straight line segments between two points.",
|
15 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-LINE"
|
16 |
+
},
|
17 |
+
"CIRCLE": {
|
18 |
+
"description": "Creates a circle based on a center point and radius.",
|
19 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-CIRCLE"
|
20 |
+
},
|
21 |
+
"ARC": {
|
22 |
+
"description": "Creates an arc defined by three points.",
|
23 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-ARC"
|
24 |
+
},
|
25 |
+
"SPLINE": {
|
26 |
+
"description": "Creates a spline curve through a set of points.",
|
27 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-SPLINE"
|
28 |
+
}
|
29 |
},
|
30 |
+
"MODIFYING": {
|
31 |
+
"MOVE": {
|
32 |
+
"description": "Moves objects a specified distance in a specified direction.",
|
33 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-MOVE"
|
34 |
+
},
|
35 |
+
"COPY": {
|
36 |
+
"description": "Copies objects a specified distance in a specified direction.",
|
37 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-COPY"
|
38 |
+
},
|
39 |
+
"ROTATE": {
|
40 |
+
"description": "Rotates objects around a base point.",
|
41 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-ROTATE"
|
42 |
+
},
|
43 |
+
"SCALE": {
|
44 |
+
"description": "Scales objects proportionally from a specified base point.",
|
45 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-SCALE"
|
46 |
+
},
|
47 |
+
"EXPLODE": {
|
48 |
+
"description": "Breaks a compound object into its constituent objects.",
|
49 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-EXPLODE"
|
50 |
+
}
|
51 |
},
|
52 |
+
"DIMENSIONS": {
|
53 |
+
"DIMLINEAR": {
|
54 |
+
"description": "Creates a linear dimension between two points.",
|
55 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-DIMLINEAR"
|
56 |
+
},
|
57 |
+
"DIMRADIUS": {
|
58 |
+
"description": "Creates a dimension that measures the radius of a circle or arc.",
|
59 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-DIMRADIUS"
|
60 |
+
},
|
61 |
+
"DIMDIAMETER": {
|
62 |
+
"description": "Creates a dimension that measures the diameter of a circle or arc.",
|
63 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-DIMDIAMETER"
|
64 |
+
}
|
65 |
},
|
66 |
+
"VIEWING": {
|
67 |
+
"ZOOM": {
|
68 |
+
"description": "Changes the view of your drawing to a specific zoom level.",
|
69 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-ZOOM"
|
70 |
+
},
|
71 |
+
"PAN": {
|
72 |
+
"description": "Pans the view of your drawing.",
|
73 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-PAN"
|
74 |
+
},
|
75 |
+
"3DVIEW": {
|
76 |
+
"description": "Sets the 3D view angle and position.",
|
77 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-3DVIEW"
|
78 |
+
}
|
79 |
},
|
80 |
+
"LAYER_MANAGEMENT": {
|
81 |
+
"LAYER": {
|
82 |
+
"description": "Manages drawing layers and their properties.",
|
83 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-LAYER"
|
84 |
+
},
|
85 |
+
"LAYERSTATE": {
|
86 |
+
"description": "Saves and restores layer settings.",
|
87 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-LAYERSTATE"
|
88 |
+
}
|
89 |
},
|
90 |
+
"OTHER": {
|
91 |
+
"UNDO": {
|
92 |
+
"description": "Reverses the last action or command.",
|
93 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-UNDO"
|
94 |
+
},
|
95 |
+
"REDO": {
|
96 |
+
"description": "Reapplies the most recent undone action.",
|
97 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-REDO"
|
98 |
+
},
|
99 |
+
"SAVE": {
|
100 |
+
"description": "Saves the current drawing to a file.",
|
101 |
+
"link": "https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-SAVE"
|
102 |
+
}
|
103 |
}
|
|
|
104 |
}
|
105 |
|
106 |
+
# Custom CSS for styling
|
|
|
|
|
|
|
107 |
st.markdown("""
|
108 |
<style>
|
109 |
.stApp {
|
|
|
145 |
# Title
|
146 |
st.markdown('<div class="title">π AutoCAD Command Explorer</div>', unsafe_allow_html=True)
|
147 |
|
148 |
+
# Filter categories
|
149 |
+
categories = list(commands.keys())
|
150 |
+
|
151 |
+
# Category filter dropdown
|
152 |
+
category = st.selectbox("Select a Category:", categories)
|
153 |
+
|
154 |
+
# Get the list of commands from the selected category
|
155 |
+
category_commands = commands[category]
|
156 |
+
|
157 |
+
# Command dropdown in selected category
|
158 |
+
selected_cmd = st.selectbox("Select a Command:", sorted(category_commands.keys()))
|
159 |
+
|
160 |
+
# Layout: Description on the right
|
161 |
col1, col2 = st.columns([1, 2])
|
162 |
|
163 |
with col1:
|
164 |
+
# Show description and link of the selected command
|
165 |
+
cmd = category_commands[selected_cmd]
|
|
|
|
|
166 |
st.markdown(f"""
|
167 |
<div class="desc-box">
|
168 |
<div class="desc-title">π οΈ {selected_cmd}</div>
|
169 |
+
<div class="desc-text">{cmd['description']}</div>
|
170 |
<div class="desc-link">
|
171 |
+
π <a href="{cmd['link']}" target="_blank">Learn More</a>
|
172 |
</div>
|
173 |
</div>
|
174 |
""", unsafe_allow_html=True)
|