liuyang4740 发表于 2008-6-5 16:47:00

求助:将选择集中的2条直线倒角

求助高手:怎样将选择集内的2条直线倒角(chamfer)

fjfhgdwfn 发表于 2008-6-5 20:31:00

用sendcommand就行了啊。

liuyang4740 发表于 2008-6-7 13:30:00

<p>使用下面命令还是不行啊?我选择集就2条直线</p><p></p><p>Sub fd()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '倒角<br/>&nbsp;&nbsp;&nbsp; Dim returnObj As AcadEntity<br/>&nbsp;&nbsp;&nbsp; Dim y(1 To 3) As Double<br/>&nbsp;&nbsp;&nbsp; Dim ss As Variant<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; On Error Resume Next<br/>&nbsp;&nbsp;&nbsp; SsetName = "au100"<br/>&nbsp;&nbsp;&nbsp; On Error Resume Next<br/>&nbsp;&nbsp;&nbsp; For i = 0 To ThisDrawing.SelectionSets.Count - 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set SsetObj = ThisDrawing.SelectionSets.Item(i)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If SsetObj.Name = "au100" Then SsetObj.Delete<br/>&nbsp;&nbsp;&nbsp; Next i<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set SsetObj = ThisDrawing.SelectionSets.Add(SsetName)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SsetObj.SelectOnScreen<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.SendCommand "_chamfer" &amp; vbCr &amp; "D" &amp; vbCr &amp; "400" &amp; vbCr &amp; vbCr &amp; SsetObj.item(0) &amp;&nbsp;SsetObj.item(1) &amp; vbCr</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>End Sub<br/></p>

fjfhgdwfn 发表于 2008-6-7 22:07:00

<p>要通过handent传递参数</p><p>参见</p><p><a href="http://www.mjtd.com/Develop/ArticleShow.asp?ArticleID=49">http://www.mjtd.com/Develop/ArticleShow.asp?ArticleID=49</a></p>
页: [1]
查看完整版本: 求助:将选择集中的2条直线倒角