楼主的问题可否这样解决? xyz = 1 '比例 ThisDrawing.SendCommand "(setq xyz " & xyz & ")" & vbCr ThisDrawing.SendCommand "(command ""leader"" pause pause ""F"" ""N"" ""A"" """" ""b"" ""1.dwg"" ""s"" xyz pause """" )" & vbCr
不使用command的话也可以这样做: Sub leader() pt1 = ThisDrawing.Utility.GetPoint(, "指定引线起点") pt2 = ThisDrawing.Utility.GetPoint(pt1, "指定下一点") pt0 = ThisDrawing.Utility.GetPoint(, "指定插入点") lsppt1 = axPoint2lspPoint(pt1) lsppt2 = axPoint2lspPoint(pt2) lsppt0 = axPoint2lspPoint(pt0) xyz = 1 '比例 ThisDrawing.SendCommand "leader" & vbCr & lsppt1 & vbCr & lsppt2 & vbCr & "F" & vbCr & "N" & vbCr & "A" & vbCr & vbCr & "b" & vbCr & "1.dwg" & vbCr & "s" & vbCr & xyz & vbCr & lsppt0 & vbCr & vbCr End Sub Public Function axPoint2lspPoint(ByVal Pnt As Variant) As String axPoint2lspPoint = Pnt(0) & "," & Pnt(1) & "," & Pnt(2) End Function
|