又来请教大家,关于sendcommand的使用
我在用VBA编程时,需要用到边界曲面的功能(没法,用add3dmesh感觉太复杂,二维图是现在的)想用sendcommand的功能调用edgesurf命令,但edgesurf执行后要接下来选择4根线条,如何用程序传递给它呢?谢谢! 这个跟我发的那个求助贴意思差不多,就是涉及到,在vba窗口出现的情况下,怎么实现选择自己要修改的图形。我也期待。 <p>都说了使用选择集</p><p>好像刚回复果类似问题</p><p>lsp语句利用setq s1(entlast) (有关最后选择集的方式都可以)</p><p>vba则是新建选择集利用acSelectionSetLast模式</p><p>在选择对象时使用 p 参数即上一个选择集</p><p>所有这类操作都是这个样子</p> <p>楼上介绍的方法和于其它命令是可行的。我用VBA,其中SS1、SS2、SS3、SS4是四个选择集,每个集中选择了一根线条,但执行时就不行了</p><p>ThisDrawing.SendCommand "edgesurf" & vbCr & "ss1" & vbCr & "ss2" & vbCr & "ss3" & vbCr & "ss4" & vbCr</p><p>这一种方法也不行</p><p>ThisDrawing.SendCommand "edgesurf" & vbCr & "setq s1(ss1)" & vbCr & "setq s2(ss2)" & vbCr & "setq s3(ss3)" & vbCr & "setq s4(ss4)" & vbCr</p><p>请指点,谢谢!</p> <p>下载vlax.cls或也可用USERS1-5来传递Handle</p><p>Sub test()<br/>Dim lineObj1 As AcadLine<br/>Dim lineObj2 As AcadLine<br/>Dim lineObj3 As AcadLine<br/>Dim lineObj4 As AcadLine<br/>Dim pt1(0 To 2) As Double<br/>Dim pt2(0 To 2) As Double<br/>Dim pt3(0 To 2) As Double<br/>Dim pt4(0 To 2) As Double<br/>pt1(0) = 0#: pt1(1) = 0#: pt1(2) = 0#<br/>pt2(0) = 2#: pt2(1) = 3#: pt2(2) = -5#<br/>pt3(0) = 1#: pt3(1) = 5#: pt3(2) = 8#<br/>pt4(0) = 4#: pt4(1) = 0#: pt4(2) = 2#<br/>Set lineObj1 = ThisDrawing.ModelSpace.AddLine(pt1, pt2)<br/>Set lineObj2 = ThisDrawing.ModelSpace.AddLine(pt2, pt3)<br/>Set lineObj3 = ThisDrawing.ModelSpace.AddLine(pt3, pt4)<br/>Set lineObj4 = ThisDrawing.ModelSpace.AddLine(pt4, pt1)</p><p>Dim VL As New VLAX<br/>VL.SetLispSymbol "hd1", lineObj1.Handle<br/>VL.SetLispSymbol "hd2", lineObj2.Handle<br/>VL.SetLispSymbol "hd3", lineObj3.Handle<br/>VL.SetLispSymbol "hd4", lineObj4.Handle<br/>ThisDrawing.SendCommand "(command ""edgesurf"" (Handent hd1) (Handent hd2) (Handent hd3) (Handent hd4)) "<br/>End Sub</p> <p>谢谢!显然这个办法更简便,不需要其它支持。</p><p></p><p>Dim lineObj1 As AcadLine<br/>Dim lineObj2 As AcadLine<br/>Dim lineObj3 As AcadLine<br/>Dim lineObj4 As AcadLine<br/>Dim pt1(0 To 2) As Double<br/>Dim pt2(0 To 2) As Double<br/>Dim pt3(0 To 2) As Double<br/>Dim pt4(0 To 2) As Double<br/>pt1(0) = 0#: pt1(1) = 0#: pt1(2) = 0#<br/>pt2(0) = 2#: pt2(1) = 3#: pt2(2) = -5#<br/>pt3(0) = 1#: pt3(1) = 5#: pt3(2) = 8#<br/>pt4(0) = 4#: pt4(1) = 0#: pt4(2) = 2#<br/>Set lineObj1 = ThisDrawing.ModelSpace.AddLine(pt1, pt2)<br/>Set lineObj2 = ThisDrawing.ModelSpace.AddLine(pt2, pt3)<br/>Set lineObj3 = ThisDrawing.ModelSpace.AddLine(pt3, pt4)<br/>Set lineObj4 = ThisDrawing.ModelSpace.AddLine(pt4, pt1)<br/>ThisDrawing.SendCommand "edgesurf" & vbCr & "(Handent """ & lineObj1.Handle & """)" & vbCr & "(Handent """ & lineObj2.Handle & """)" & vbCr & "(Handent """ & lineObj3.Handle & """)" & vbCr & "(Handent """ & lineObj4.Handle & """)" & vbCr<br/></p>
页:
[1]