Pt(0) = 0: Pt(1) = (HS + h10(i)) / 2 + (i - 1) * ucs ThisDrawing.SendCommand "-Boundary" & vbCr & Pt(0) & "," & Pt(1) & vbCr & vbCr Set lwpLineObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) S = lwpLineObj.Area lwpLineObj.Delete '写面积 PMJ(0) = 4: PMJ(1) = -6 + h10(i) + (i - 1) * ucs: PMJ(2) = 0 hMJ = 0.6 deltah = h10(i) - HS If deltah > 0 Then Aw = Format(deltah, "0.000"): mtextmj = "Aw=" & S ElseIf deltah < 0 Then At = Format(Abs(deltah), "0.000"): mtextmj = "At=" & S End If ThisDrawing.ActiveLayer = courtlay4 Set mjtext = ThisDrawing.ModelSpace.AddText(mtextmj, PMJ, hMJ) Next i 绘制横断面,面积是借用网上的,对某些部分不理解 逐行运行都可以的,总体运行就出错: 1、多段线并不删除 2、没有显示需要的数据,都是0 请各位指教! |