|
vba取直线俩端点与中的不一致,取的是x轴和y轴 在cad中显示 两个端点 x =0 或者 y =0 但是通过vba取出来却不是.是那里出现了误差?怎么解决?只有一个正确.
0 -239.524761643031 0 302.065585840464
392.5594 0 -360 1.4210854715202E-13
-2.27373675443232E-13 7.105427357601E-14 39.9999999999998 -11.9999999999997
-40.0000000000002 15.0000000000001 -2.27373675443232E-13 7.105427357601E-14
Public Sub shanchu()
Dim fs
Dim a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ThisDrawing.Path + ThisDrawing.Name + ".txt", True)
Dim item As AcadEntity
Dim eLine As AcadLine
For Each item In ThisDrawing.ModelSpace
'a.writeline (item.EntityName)
If (item.EntityName = "AcDbLine") Then
Set eLine = item
a.writeline (eLine.StartPoint(0) & " " & eLine.StartPoint(1) & " " & eLine.EndPoint(0) & " " & eLine.EndPoint(1))
End If
Next
a.Close
End Sub
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |
|