Kamran Zulfiqar commited on
Commit
cafcf3b
Β·
verified Β·
1 Parent(s): 16f1caa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +112 -31
app.py CHANGED
@@ -1,38 +1,109 @@
1
  import streamlit as st
2
 
3
- # Sample command data (replace or expand with real commands later)
 
 
 
4
  commands = {
5
- "LINE": {
6
- "description": "Creates straight line segments between two points.",
7
- "link": "https://www.youtube.com/watch?v=4Hsb5j5JH7A"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  },
9
- "CIRCLE": {
10
- "description": "Creates a circle based on a center point and radius.",
11
- "link": "https://www.youtube.com/watch?v=ZFbP13bU5Ck"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  },
13
- "TRIM": {
14
- "description": "Trims objects to meet the edges of other objects.",
15
- "link": "https://www.youtube.com/watch?v=8QULwXuHEjM"
 
 
 
 
 
 
 
 
 
 
16
  },
17
- "OFFSET": {
18
- "description": "Creates concentric circles, parallel lines, and curves at specified distances.",
19
- "link": "https://www.youtube.com/watch?v=3AwYIjvQqek"
 
 
 
 
 
 
 
 
 
 
20
  },
21
- "MOVE": {
22
- "description": "Moves objects a specified distance in a specified direction.",
23
- "link": "https://www.youtube.com/watch?v=gzS4h3rzFeM"
 
 
 
 
 
 
24
  },
25
- "ROTATE": {
26
- "description": "Rotates objects around a base point.",
27
- "link": "https://www.youtube.com/watch?v=s7KAMdUHz4E"
 
 
 
 
 
 
 
 
 
 
28
  }
29
- # You can add up to 200 commands here
30
  }
31
 
32
- # App config
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
- # Layout: Dropdown on left, Description on right
 
 
 
 
 
 
 
 
 
 
 
 
78
  col1, col2 = st.columns([1, 2])
79
 
80
  with col1:
81
- selected_cmd = st.selectbox("Choose an AutoCAD Command:", list(commands.keys()), index=0)
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">{cmd_data['description']}</div>
89
  <div class="desc-link">
90
- πŸ“Ί <a href="{cmd_data['link']}" target="_blank">Watch Tutorial</a>
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)