以下是求面域周长的代码,求内轮廓都行,但为什么求外轮廓的周长就不行呢?
Public Sub clist() Dim pt As Variant Dim spt As String Dim i As Integer
pt = ThisDrawing.Utility.getpoint(, vbCrLf & "输入要计算周长对象的内部一点:") spt = pt(0) & "," & pt(1) ThisDrawing.SendCommand "-boundary" & vbCr & "a" & vbCr & "o" & vbCr & "r" & vbCr & vbCr & spt & vbCr & vbCr If (ThisDrawing.GetVariable("LASTPROMPT") <> "已创建 0 个面域。") Then MsgBox ThisDrawing.ModelSpace(ThisDrawing.ModelSpace.Count - 1).Perimeter ThisDrawing.ModelSpace(ThisDrawing.ModelSpace.Count - 1).Delete End If End Sub |