雪山飞狐_lzh 发表于 2004-5-27 12:26:00

你是怎麽干得?



应该:


dim docapp as AcadDocument


set docapp=acadapp.ActiveDocument


docapp.SendCommand "_Circle 2,2,0 4 "

雪山飞狐_lzh 发表于 2004-5-27 12:41:00

Sub Test()<BR>Dim ss As AcadSelectionSet<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>ss.Clear<BR>ss.SelectOnScreen<BR>ThisDrawing.SendCommand "_.fillet" &amp; vbCr &amp; "r" &amp; vbCr &amp; "1" &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(0).Handle &amp; Chr(34) &amp; ")" &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(1).Handle &amp; Chr(34) &amp; ")" &amp; vbCr


End Sub<BR>

yingxunxue 发表于 2004-5-27 13:13:00

'ss.SelectOnScreen'这条语句只能在屏幕上选择以后才执行下面的语句,有没有直接通过程序选择.ThisDrawing.ModelSpace(ThisDrawing.ModelSpace.Count - 1)是取模型空间的最后一个实体,如果我不知道是选择的对象是第几个,又该怎么做.用句柄返回可以吗?怎么实现

雪山飞狐_lzh 发表于 2004-5-27 13:16:00

那你的直线对象是如何获取的呢?

yingxunxue 发表于 2004-5-27 15:07:00

Dim pEntity(0) As AcadEntity


Set pEntity(0) = acadDoc.ModelSpace(acadDoc.ModelSpace.count - 1)


这样获取的,或者是 Set lp = MdSpace.AddLine(point, point1)


这样都能实现!我想问的不知道对象名称的情况下(比如重复的的使用Set lp = MdSpace.AddLine(point, point1),对象名称(lp)无法引用.


我想知道句柄的使用,希望能指点呀

雪山飞狐_lzh 发表于 2004-5-27 17:31:00

你可以用直线数组保存直线对象,或者字符串数组保存直线对象的句柄


用ThisDrawing.HandletoObject通过句柄返回图形对象

yingxunxue 发表于 2004-5-27 17:37:00

真的非常感谢你的指教,

riechie 发表于 2004-5-27 22:37:00

非常感谢!!!

riechie 发表于 2004-5-28 10:01:00

<TABLE class=tablebody2 style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" width="90%" border=0>
<TBODY>
<TR>
<TD style="FONT-SIZE: 9pt; LINE-HEIGHT: 12pt" width="100%"><IMG alt=发贴心情 src="http://www.mjtd.com/bbs/skins/default/topicface/face1.gif" border=0>        <B></B><BR>Sub Test()<BR>Dim ss As AcadSelectionSet<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>ss.Clear<BR>ss.SelectOnScreen<BR>ThisDrawing.SendCommand "_.fillet" &amp; vbCr &amp; "r" &amp; vbCr &amp; "1" &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(0).Handle &amp; Chr(34) &amp; ")" &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(1).Handle &amp; Chr(34) &amp; ")" &amp; vbCr



End Sub<BR>

</TD></TR></TBODY></TABLE>怎么把计算的值用来作导角半径!也就是用字母取代"1" !!

雪山飞狐_lzh 发表于 2004-5-28 10:33:00

ThisDrawing.SendCommand "_.fillet" &amp; vbCr &amp; "r" &amp; vbCr &amp;        myR &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(0).Handle &amp; Chr(34) &amp; ")" &amp; vbCr &amp; "(handent " &amp; Chr(34) &amp; ss(1).Handle &amp; Chr(34) &amp; ")" &amp; vbCr
页: 1 [2] 3
查看完整版本: 有空过来看看,倒角圆角求助