线不能串连
<P>本人这样写了一个将线串连的程式,可是不能串连</P><P>请大师指教,希望可以帮忙修改一下,谢谢</P>
<P>Public Sub j()<BR>Dim obj As AcadEntity, pt As Variant, selobj As AcadEntity, ssetobj As AcadSelectionSet<BR>ThisDrawing.Utility.GetEntity obj, pt: obj.Highlight True<BR>On Error Resume Next<BR>ThisDrawing.SelectionSets("j").Delete<BR>Err.Clear<BR>Set ssetobj = ThisDrawing.SelectionSets.Add("j")<BR>Dim cmd As String<BR>cmd = "pe" & vbCr & obj & "j" & vbCr & ssetobj & vbCr<BR>ThisDrawing.SendCommand cmd<BR>End Sub<BR></P> 实体和选择集怎么能作为命令行中的东东出现呢?可能得用LISP了,会LISP的高手帮帮忙吧。。。。。 <P>但是vba應該也是可以做的啊,版主能否指教本人一二,谢谢!</P> <P>好像很復杂!!!</P> <P>没有高手出面,自立更生啦,看下面的程序吧!</P>
<P>Sub main()<BR>Dim obj As AcadEntity, pt As Variant, selobj As AcadEntity, ssetobj As AcadSelectionSet<BR>ThisDrawing.Utility.GetEntity obj, pt: obj.Highlight True<BR>On Error Resume Next<BR>ThisDrawing.SelectionSets("j").Delete<BR>Err.Clear<BR>Set ssetobj = ThisDrawing.SelectionSets.Add("j")<BR>ssetobj.SelectOnScreen</P>
<P>Dim cmd As String<BR>cmd = "pe" & vbCr & "(handent """ & obj.Handle & """)" & vbCr & "j" & vbCr<BR>Dim i As Integer<BR>For i = 0 To ssetobj.Count<BR> cmd = cmd & "(handent """ & ssetobj.Item(i).Handle & """)" & vbCr<BR>Next</P>
<P>ThisDrawing.SendCommand cmd & vbCr & vbCr<BR>End Sub</P> <P>兄台,不行的,我用过,并没有串连,管理员可以帮忙吗</P> <P>在我这运行没有问题,报错吗?</P> 是选过后没有串连 我先选一个pline线,再选中3,4根Line,没有问题,要不你把你的图传上来睽睽吧! Public Sub j()<BR>Dim ssetobj As AcadSelectionSet<BR>On Error Resume Next<BR>ThisDrawing.SelectionSets("j").Delete<BR>Err.Clear<BR>Set ssetobj = ThisDrawing.SelectionSets.Add("j")<BR>ssetobj.SelectOnScreen<BR>Dim cmd As String<BR>cmd = "pe" & vbCr & "m" & vbCr & "p" & vbCr & vbCr & "y" & vbCr & "j" & vbCr & vbCr & vbCr<BR>ThisDrawing.SendCommand cmd<BR>End Sub
页:
[1]
2