我进行了一个尝试,可是到那个sendcommand命令时总是执行错误,请帮我改改,谢谢! Dim oAcadApp Public Sub SelectAtPoint(ByRef SSet As AcadSelectionSet, ByVal pt As Variant) 'SSet.Select acSelectionSetCrossing, pt, pt Dim pt1 As Variant, pt2 As Variant Dim objUtility As Object Set objUtility = oAcadApp.ActiveDocument.Utility ' 必须使用后期绑定 objUtility.CreateTypedArray pt1, vbDouble, pt(0) - 0.0001, pt(1) - 0.0001, pt(2) objUtility.CreateTypedArray pt2, vbDouble, pt(0) + 0.0001, pt(1) + 0.0001, pt(2) SSet.Select acSelectionSetCrossing, pt1, pt2 End Sub Private Sub Command10_Click() Dim pt1(0 To 2) As Double Dim pt2(0 To 2) As Double Dim pt5(0 To 2) As Double Dim ss As AcadSelectionSet Dim dd As AcadSelectionSet Dim line1, line2, r1 pt1(0) = 0 pt1(1) = 0 pt1(2) = 0 pt5(0) = 5 pt5(1) = 0 pt5(2) = 0 pt2(0) = 10 pt2(1) = 0 pt2(2) = 0 Dim pt3(0 To 2) As Double Dim pt4(0 To 2) As Double Dim pt6(0 To 2) As Double pt3(0) = 1 pt3(1) = 0 pt3(2) = 0 pt4(0) = 1 pt4(1) = 10 pt4(2) = 0 pt6(0) = 1 pt6(1) = 5 pt6(2) = 0 r1 = 1 Set line1 = AddLine(pt1, pt2) Set line2 = AddLine(pt4, pt3) Set ss = oAcadApp.ActiveDocument.SelectionSets.Add("d1") Set dd = oAcadApp.ActiveDocument.SelectionSets.Add("d2") SelectAtPoint ss, pt5 SelectAtPoint dd, pt6 Dim x1 As AcadLine Dim x2 As AcadLine Set x1 = ss.Item(0) Set x2 = dd.Item(0) MsgBox "A new SelectionSet called " & ss.Count & " has been added to the SelectionSets collection.", vbInformation, "SelectionSets 示例" MsgBox "A new SelectionSet called " & dd.Count & " has been added to the SelectionSets collection.", vbInformation, "SelectionSets 示例" oAcadApp.ActiveDocument.SendCommand "_FILLET" & vbCr & "r" & vbCr & r1 & vbCr & _ "(handent " & Chr(34) & x1.Handle & Chr(34) & ")" & vbCr & "(handent " & Chr(34) & x2.Handle & Chr(34) & ")" & vbCr End Sub
|