请问如何在图形窗口之间切换啊
小弟我在当前图形窗口获得了一些点的数据,然后创建了一个新的窗口用这些数据作了条多线段。可是我还想回到原来的图形窗口进行一些操作,请问我该怎么做呢???<FONT color=#ff0000>我试验的代码:</FONT>
<FONT face=宋体 color=#ff0000> Dim dName As String, dPath, File<BR> dName = ThisDrawing.name<BR> dPath = ThisDrawing.Path<BR> MsgBox (dPath) & " " & (dName)<BR> File = ((dPath) & " " & (dName))<BR> Application.Documents.Add<BR> ThisDrawing.Application.Documents.Open (File)</FONT>
<FONT face=宋体 color=#ff0000>其中MsgBox显示了当前窗口的路径和文件名,可是添加了新窗口后Open语句却出错说找不到该文件???请问我该怎么办啊</FONT>
还想请问一下:(1)创建的新窗口可以自己命名吗?默认的是drawing1
(2)我的一个数组里存有很多点的数据。现在我想以相邻两点在XOY面上的距离为横坐标,Z差为纵坐标形成一个新的数组,盖怎么做呢??循环嵌套??
There should be a "\" between path and filename. 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
页:
[1]