This repository has been archived by the owner on Dec 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
/
_diff.txt
67 lines (62 loc) · 2.36 KB
/
_diff.txt
1
2
3
4
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff --git a/examples/vbnet/ex_leader.vb b/examples/vbnet/ex_leader.vb
index 5b6a61d..40da3e4 100644
--- a/examples/vbnet/ex_leader.vb
+++ b/examples/vbnet/ex_leader.vb
@@ -1,43 +1,43 @@
Imports Rhino
Imports Rhino.Geometry
Imports Rhino.Commands
-Imports Rhino.Input.Custom
Imports System.Collections.Generic
Imports System.Linq
Namespace examples_vb
- <System.Runtime.InteropServices.Guid("55EDA992-FF8B-4523-BF81-76FEE65E90F6")> _
- Public Class ex_leader
- Inherits Rhino.Commands.Command
+ <System.Runtime.InteropServices.Guid("055686DA-E4DF-4241-99AF-212546C26F08")> _
+ Public Class LeaderCommand
+ Inherits Command
Public Overrides ReadOnly Property EnglishName() As String
Get
Return "vbLeader"
End Get
End Property
- Protected Overrides Function RunCommand(doc As RhinoDoc, mode As Rhino.Commands.RunMode) As Rhino.Commands.Result
- Dim points = New List(Of Point3d)()
- points.Add(New Point3d(1, 1, 0))
- points.Add(New Point3d(5, 1, 0))
- points.Add(New Point3d(5, 5, 0))
- points.Add(New Point3d(9, 5, 0))
+ Protected Overrides Function RunCommand(doc As RhinoDoc, mode As RunMode) As Result
+ Dim points = New List(Of Point3d)() From { _
+ New Point3d(1, 1, 0), _
+ New Point3d(5, 1, 0), _
+ New Point3d(5, 5, 0), _
+ New Point3d(9, 5, 0) _
+ }
Dim xyPlane = Plane.WorldXY
- Dim pts2d = New List(Of Point2d)()
- For Each pt3d As Point3d In points
+ Dim points2d = New List(Of Point2d)()
+ For Each point3d As Point3d In points
Dim x As Double, y As Double
- If xyPlane.ClosestParameter(pt3d, x, y) Then
- Dim pt2d = New Point2d(x, y)
- If pts2d.Count < 1 OrElse pt2d.DistanceTo(pts2d.Last()) > RhinoMath.SqrtEpsilon Then
- pts2d.Add(pt2d)
+ If xyPlane.ClosestParameter(point3d, x, y) Then
+ Dim point2d = New Point2d(x, y)
+ If points2d.Count < 1 OrElse point2d.DistanceTo(points2d.Last(Of Point2d)()) > RhinoMath.SqrtEpsilon Then
+ points2d.Add(point2d)
End If
End If
Next
- doc.Objects.AddLeader(xyPlane, pts2d)
+ doc.Objects.AddLeader(xyPlane, points2d)
doc.Views.Redraw()
- Return Rhino.Commands.Result.Success
+ Return Result.Success
End Function
End Class
End Namespace
\ No newline at end of file