- Sub tttt()
- Dim doc1 As AcadDocument
- Dim doc2 As AcadDocument
- Set doc1 = Application.ActiveDocument
- Set doc2 = Application.Documents.Add()
- doc2.Activate
- ThisDrawing.Utility.GetPoint
- doc1.Activate
- End Sub
创建的新窗口不可以自己命名- Function ChangePnts(pnts As Variant)
- Dim p1, p2
- Dim p(2) As Double
- Dim dots()
- ReDim dots(UBound(pnts) - 1)
- For i = 0 To UBound(pnts) - 1
- p1 = pnts(i)
- p2 = pnts(i + 1)
- p(0) = ((p1(0) - p2(0)) ^ 2 + (p1(1) - p2(1)) ^ 2) ^ 0.5
- p(1) = Abs(p1(2) - p2(2))
- dots(i) = p
- Next i
- ChangePnts = dots
- End Function
|