- 积分
- 237
- 明经币
- 个
- 注册时间
- 2006-3-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2006-4-4 13:54:00
|
显示全部楼层
- Dim iPoint As Variant
- iPoint = ThisDrawing.Utility.GetPoint(, "Please specify table insert point:")
- Dim MyModelSpace As IAcadModelSpace2
- Set MyModelSpace = ThisDrawing.ModelSpace
- Dim tb As AcadTable
- Set tb = MyModelSpace.AddTable(iPoint, 2, 5, txtHeight * 2, txtHeight * 1.2)
- tb.HorzCellMargin = txtHeight / 2
- tb.VertCellMargin = txtHeight / 2
- tb.SetTextHeight acDataRow, txtHeight * 2
- tb.SetTextHeight acHeaderRow, txtHeight * 2
- tb.SetTextHeight acTitleRow, txtHeight * 2
- tb.SetAlignment acDataRow, acMiddleCenter
- tb.SetAlignment acHeaderRow, acMiddleCenter
- tb.SetAlignment acTitleRow, acMiddleCenter
- 'tb.SetTextStyle acDataRow, "iStyle"
- 'tb.SetTextStyle acHeaderRow, "iStyle"
- 'tb.SetTextStyle acTitleRow, "iStyle"
-
- tb.SetRowHeight 0, txtHeight * 8
- tb.SetRowHeight 1, txtHeight * 8
-
- tb.SetColumnWidth 0, txtHeight * 2 * 5
- tb.SetColumnWidth 1, txtHeight * 2 * 12
- tb.SetColumnWidth 2, txtHeight * 2 * 12
- tb.SetColumnWidth 3, txtHeight * 2 * 10
- tb.SetColumnWidth 4, txtHeight * 2 * 10
- tb.SetText 0, 0, "WIRE LIST"
- tb.SetText 1, 0, "NO."
- tb.SetText 1, 1, "START POINT"
- tb.SetText 1, 2, "END POINT"
- tb.SetText 1, 3, "DISTANCE"
- tb.SetText 1, 4, "LENGTH"
- Do While Num > 0
- ThisDrawing.Utility.InitializeUserInput 0, "D E"
- On Error Resume Next
- pt1 = ThisDrawing.Utility.GetPoint(, "Please specify first point[or (D=Delete last wire) or (E=Exit)]:")
- If Err.Number = -2145320928 Then
- Dim Sel As String
- Sel = ThisDrawing.Utility.GetInput
- If LCase(Sel) = "e" Then
- Exit Do
- ElseIf LCase(Sel) = "d" Then
- No = No - 1
- objPline.Delete
- objHatch.Delete
- ThisDrawing.SendCommand "Erase" + vbCr + CStr(pt2(0)) + "," + CStr(pt2(1)) + vbCr + vbCr
- tb.DeleteRows tb.Rows - 1, 1
- pt1 = ThisDrawing.Utility.GetPoint(, "Please specify first point:")
- End If
- End If
-
- pt2 = ThisDrawing.Utility.GetPoint(pt1, "Please specify second point:")
- tb.InsertRows tb.Rows, txtHeight * 1.75, 1
-
- tb.SetText tb.Rows - 1, 0, CStr(No)
-
- Txt = CStr(Round(pt1(0), 5)) + " , " + CStr(Round(pt1(1), 5))
- If Left(Txt, 1) = "." Then Txt = "0" + Txt
- If tb.GetColumnWidth(1) < txtHeight * 2.5 * Len(Txt) Then
- tb.SetColumnWidth 1, txtHeight * 2.5 * Len(Txt)
- End If
- tb.SetText tb.Rows - 1, 1, Txt
-
- Txt = CStr(Round(pt2(0), 5)) + " , " + CStr(Round(pt2(1), 5))
- If Left(Txt, 1) = "." Then Txt = "0" + Txt
- If tb.GetColumnWidth(2) < txtHeight * 2.5 * Len(Txt) Then
- tb.SetColumnWidth 2, txtHeight * 2.5 * Len(Txt)
- End If
- tb.SetText tb.Rows - 1, 2, Txt
-
- Txt = CStr(Round(objPline.Length, 5))
- If Left(Txt, 1) = "." Then Txt = "0" + Txt
- If tb.GetColumnWidth(3) < txtHeight * 2 * Len(Txt) Then
- tb.SetColumnWidth 3, txtHeight * 2 * Len(Txt)
- End If
- tb.SetText tb.Rows - 1, 3, Txt
- No = No + 1
-
- Loop
|
|