Skip to content

Commit 685530f

Browse files
committed
loads and supports
1 parent 132cbf3 commit 685530f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

commands/TNA_loads.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def RunCommand():
3535

3636
rs.UnselectAllObjects()
3737

38-
options = ["Add", "Remove"]
38+
options = ["Add", "Clear All"]
3939
option = rs.GetString("Add or Remove supports", strings=options)
4040
if not option:
4141
return
@@ -63,7 +63,7 @@ def RunCommand():
6363
pz = formdiagram.vertex_attribute(key, "pz") or 0
6464
formdiagram.vertex_attribute(key, "pz", pz + load)
6565

66-
elif option == "Remove":
66+
elif option == "Clear All":
6767
formobject.mesh.vertices_attribute(name="pz", value=0)
6868

6969
else:
@@ -75,6 +75,7 @@ def RunCommand():
7575

7676
rs.UnselectAllObjects()
7777

78+
formobject.show_vertices = True # type: ignore
7879
formobject.show_edges = True # type: ignore
7980
formobject.show_faces = False # type: ignore
8081
formobject.redraw()

commands/TNA_supports.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def RunCommand():
3131

3232
rs.UnselectAllObjects()
3333

34-
options = ["Add", "Remove"]
35-
option = rs.GetString("Add or Remove supports", strings=options)
34+
option = rs.GetString("Add or Remove supports", strings=["Add", "Remove", "Clear All"])
3635
if not option:
3736
return
3837

@@ -56,12 +55,19 @@ def RunCommand():
5655
if selected:
5756
formobject.mesh.vertices_attribute(name="is_support", value=False, keys=selected)
5857

58+
elif option == "Clear All":
59+
formobject.mesh.vertices_attribute(name="is_support", value=False)
60+
61+
else:
62+
raise NotImplementedError
63+
5964
# =============================================================================
6065
# Update scene
6166
# =============================================================================
6267

6368
rs.UnselectAllObjects()
6469

70+
formobject.show_vertices = True # type: ignore
6571
formobject.show_edges = True # type: ignore
6672
formobject.show_faces = False # type: ignore
6773
formobject.redraw()

0 commit comments

Comments
 (0)