请教下如何用sendcommand 使用flatten命令
我用下面的方式没有成功。Sset1是选择集,确认有选择到图元。
烦请高手赐教。谢谢!
det = axSSet2lspEnts(SSet1)
ThisDrawing.SendCommand "flatten" & vbCr & det & vbCr & vbCr & "no" & vbCr & vbCr
Function axSSet2lspEnts(ByVal SSet As AcadSelectionSet) As String
If SSet.Count = 0 Then Exit Function
Dim enthandle As String
Dim strEnts As String
enthandle = SSet.Item(0).Handle
strEnts = "(handent " & Chr(34) & enthandle & Chr(34) & ")"
If SSet.Count > 1 Then
Dim i As Integer
For i = 1 To SSet.Count - 1
enthandle = SSet.Item(i).Handle
strEnts = strEnts & vbCr & "(handent " & Chr(34) & enthandle & Chr(34) & ")"
Next i
End If
axSSet2lspEnts = strEnts
End Function 自己先手工做一次,看差别在哪里。 谢谢老大关注。当图元过多时,给det赋值也好慢。干脆换了种方式:thisdrawing.sendcommand “_flatten” & vbCr & “_all” & vbCr & ”N” &vbCr & vbCr, 这样可以了。
页:
[1]