- 积分
- 5987
- 明经币
- 个
- 注册时间
- 2006-7-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2008-6-26 15:03:00
|
显示全部楼层
本帖最后由 作者 于 2008-6-27 13:57:47 编辑
现在要经过首尾相连的算法,使顶点顺序为1-2-3-4
619.56119 451.25179 LineCount1
486.43234 817.5741 LineCount4
791.60463 846.22501 LineCount2
969.79248 543.34399 LineCount3
619.56119 451.25179 LineCount1
AutocadToTxt文件- Sub ll()
- ThisDrawing.ActiveTextStyle.fontFile = "c:\windows\fonts\SIMHEI.TTF"
- Dim LineData As AcadLine, ArcData As AcadArc
- Dim DrawingText As AcadText, DrawingCircle As AcadCircle
- Close #1
- Open "D:\ls.txt" For Output As #1
-
- Write #1, "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10", "m11", "m12"
-
- Dim Ent As AcadEntity
- ii = 1
- For Each Ent In ThisDrawing.ModelSpace
-
- m1 = Ent.ObjectName
- m2 = Ent.ObjectID
- Select Case Ent.ObjectName
- Case "AcDbLine"
- Set LineData = Ent
-
- With LineData
- 'Set DrawingCircle = ThisDrawing.ModelSpace.AddCircle(.StartPoint, 35)
-
- m3 = Round(.StartPoint(0), 2)
- m4 = Round(.StartPoint(1), 2)
- m5 = Round(.StartPoint(2), 2)
- m6 = Round(.EndPoint(0), 2)
- m7 = Round(.EndPoint(1), 2)
- m8 = Round(.EndPoint(2), 2)
- ttt = "第" & ii & "点 " & "(" & m3 & "," & m4 & ")"
-
- Set DrawingText = ThisDrawing.ModelSpace.AddText(ttt, .EndPoint, 10)
- With DrawingText
- .Alignment = acAlignmentMiddleCenter
- .TextAlignmentPoint = LineData.StartPoint
- m9 = "第" & ii & "点"
- ii = ii + 1
- End With
-
- End With
- End Select
- Write #1, m1, m2, m3, m4, m5, m6, m7, m8, m9
-
- Next Ent
-
- Close #1
- End Sub
excel排序程序- Sub aaarrr()
- Dim rr(3, 5), rrr(4, 2)
- For ii = 6 To 9
- For jj = 3 To 7
- rr(ii - 6, jj - 3) = Sheet1.Cells(ii, jj)
- Next jj
- Next ii
- tt1 = rr(0, 0): tt2 = rr(0, 1)
- For gg = 0 To UBound(rrr)
- For ii = 0 To UBound(rr)
- If ii <> gg Then
- If tt1 = rr(ii, 0) And tt2 = rr(ii, 1) Then
- rrr(gg, 0) = rr(ii, 3): rrr(gg, 1) = rr(ii, 4):
- tt1 = rrr(gg, 0): tt2 = rrr(gg, 1)
- ElseIf tt1 = rr(ii, 3) And tt2 = rr(ii, 4) Then
- rrr(gg, 0) = rr(ii, 0): rrr(gg, 1) = rr(ii, 1):
- tt1 = rrr(gg, 0): tt2 = rrr(gg, 1)
- End If
-
- End If
-
- Next ii
-
- For ii = 0 To UBound(rrr)
- For jj = 0 To 1
- Sheet1.Cells(ii + 16, jj + 6).Value = rrr(ii, jj)
- Next jj
- Next ii
-
- Next gg
- End Sub
-
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
评分
-
查看全部评分
|