第2个回答 2022-05-04
具体实现代码如下:
Sub IntersectWith333() '''''求直线和直线及直线和圆弧的交点坐标
Dim point1, point2, point3, point4, p As Variant
Dim entLine1 As AcadLine, entLine2 As AcadLine, entLine3 As AcadLine
'输入四个点
point1 = ThisDrawing.Utility.GetPoint(, "输入第一个顶点:")
'point1(0) = 12: point1(1) = 13: point1(2) = 0
point2 = ThisDrawing.Utility.GetPoint(, "输入第二个顶点:")
'point2(0) = 13: point2(1) = 7: point2(2) = 0
point3 = ThisDrawing.Utility.GetPoint(, "输入第三个顶点:")
'point3(0) = 19: point3(1) = 12: point3(2) = 0
point4 = ThisDrawing.Utility.GetPoint(, "输入第四个顶点:")
'point3(0) = 8: point3(1) = 17: point3(2) = 0
'根据四个点画三条线
Set entLine1 = ThisDrawing.ModelSpace.AddLine(point1, point2)
Set entLine2 = ThisDrawing.ModelSpace.AddLine(point2, point3)
Set entLine3 = ThisDrawing.ModelSpace.AddLine(point3, point4)
'求直线和直线的交点坐标 及直线和圆弧
Dim intPoints As Variant
intPoints = entLine1.IntersectWith(entLine3, acExtendBoth)
MsgBox "直线1和直线3的交点:交点1坐标为" & intPoints(0) & " " & intPoints(1) & " " & intPoints(2)
'''则直线1和直线3的交点:交点1坐标为 '11.6065573770492 , 15.3606557377049 , 0
第3个回答 2022-05-06
Sub 累计()
For i = 2 To Range("A65536").End(xlUp).Row
For n = 2 To Sheets("累计表").Range("A65536").End(xlUp).Row
If Cells(i, "A") = Sheets("累计表").Cells(n, "A") Then
Cells(i, "D") = Cells(i, "C") - Sheets("累计表").Cells(n, "b")
End If
Next
Next
End Sub
你上一个查找 职称的,已回答