- 积分
- 5047
- 明经币
- 个
- 注册时间
- 2006-11-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2024-5-26 12:32:41
|
显示全部楼层
- '************************************************************************************************************************
- '
- ' 11------10
- ' | 6--7 |
- ' | | | |
- ' | | 8-9
- ' | |
- ' | |
- ' | | 3-2
- ' | | | |
- ' | 5--4 |
- ' 0------1
- Function CXG(ByVal XH As String) As Entity
- XH = XH.ToUpper.Replace("C", "")
- Dim H As Double = Val(XH.Split("X")(0))
- Dim B As Double = Val(XH.Split("X")(1))
- Dim J As Double = Val(XH.Split("X")(2))
- Dim T As Double = Val(XH.Split("X")(3))
- Dim PtBase As Point3d = New Point3d(0, 0, 0)
- Dim P0 As Point2d = New Point2d(PtBase(0), PtBase(1))
- Dim P1 As Point2d = New Point2d(PtBase(0) + B, PtBase(1))
- Dim P2 As Point2d = New Point2d(PtBase(0) + B, PtBase(1) + J)
- Dim P3 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + J)
- Dim P4 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + T)
- Dim P5 As Point2d = New Point2d(PtBase(0) + T, PtBase(1) + T)
- Dim P6 As Point2d = New Point2d(PtBase(0) + T, PtBase(1) + H - T)
- Dim P7 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + H - T)
- Dim P8 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + H - J)
- Dim P9 As Point2d = New Point2d(PtBase(0) + B, PtBase(1) + H - J)
- Dim P10 As Point2d = New Point2d(PtBase(0) + B, PtBase(1) + H)
- Dim P11 As Point2d = New Point2d(PtBase(0), PtBase(1) + H)
- Dim PL As AcDbs.Polyline = New AcDbs.Polyline
- PL.AddVertexAt(0, P0, 0, 0, 0)
- PL.AddVertexAt(1, P1, 0, 0, 0)
- PL.AddVertexAt(2, P2, 0, 0, 0)
- PL.AddVertexAt(3, P3, 0, 0, 0)
- PL.AddVertexAt(4, P4, 0, 0, 0)
- PL.AddVertexAt(5, P5, 0, 0, 0)
- PL.AddVertexAt(6, P6, 0, 0, 0)
- PL.AddVertexAt(7, P7, 0, 0, 0)
- PL.AddVertexAt(8, P8, 0, 0, 0)
- PL.AddVertexAt(9, P9, 0, 0, 0)
- PL.AddVertexAt(10, P10, 0, 0, 0)
- PL.AddVertexAt(11, P11, 0, 0, 0)
- PL.Closed = True
- TcApp.TcFuns.CAD.AddEnt(PL)
- CXG = PL
- End Function
- ' 7------6
- ' |10-11 |
- ' | | | |
- ' 8-9 | |
- ' | |
- ' | |
- ' | | 3-2
- ' | | | |
- ' | 5--4 |
- ' 0------1
- Function ZXG(ByVal XH As String) As Entity
- XH = XH.ToUpper.Replace("XZ", "")
- Dim H As Double = Val(XH.Split("X")(0))
- Dim B As Double = Val(XH.Split("X")(1))
- Dim J As Double = Val(XH.Split("X")(2))
- Dim T As Double = Val(XH.Split("X")(3))
- Dim PtBase As Point3d = New Point3d(0, 0, 0)
- Dim P0 As Point2d = New Point2d(PtBase(0), PtBase(1))
- Dim P1 As Point2d = New Point2d(PtBase(0) + B, PtBase(1))
- Dim P2 As Point2d = New Point2d(PtBase(0) + B, PtBase(1) + J)
- Dim P3 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + J)
- Dim P4 As Point2d = New Point2d(PtBase(0) + B - T, PtBase(1) + T)
- Dim P5 As Point2d = New Point2d(PtBase(0) + T, PtBase(1) + T)
- Dim P6 As Point2d = New Point2d(PtBase(0) + T, PtBase(1) + H)
- Dim P7 As Point2d = New Point2d(PtBase(0) + T - B, PtBase(1) + H)
- Dim P8 As Point2d = New Point2d(PtBase(0) + T - B, PtBase(1) + H - J)
- Dim P9 As Point2d = New Point2d(PtBase(0) + T - B + T, PtBase(1) + H - J)
- Dim P10 As Point2d = New Point2d(PtBase(0) + T - B + T, PtBase(1) + H - T)
- Dim P11 As Point2d = New Point2d(PtBase(0), PtBase(1) + H - T)
- Dim PL As AcDbs.Polyline = New AcDbs.Polyline
- PL.AddVertexAt(0, P0, 0, 0, 0)
- PL.AddVertexAt(1, P1, 0, 0, 0)
- PL.AddVertexAt(2, P2, 0, 0, 0)
- PL.AddVertexAt(3, P3, 0, 0, 0)
- PL.AddVertexAt(4, P4, 0, 0, 0)
- PL.AddVertexAt(5, P5, 0, 0, 0)
- PL.AddVertexAt(6, P6, 0, 0, 0)
- PL.AddVertexAt(7, P7, 0, 0, 0)
- PL.AddVertexAt(8, P8, 0, 0, 0)
- PL.AddVertexAt(9, P9, 0, 0, 0)
- PL.AddVertexAt(10, P10, 0, 0, 0)
- PL.AddVertexAt(11, P11, 0, 0, 0)
- PL.Closed = True
- TcApp.TcFuns.CAD.AddEnt(PL)
- ZXG = PL
- End Function
|
|