块问题
请问如何把当前图形中的所有图形做成块,并插入到其他文挡或图形中 Sub test()<BR>Dim ss As AcadSelectionSet<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>ss.Select acSelectionSetAll<BR>ThisDrawing.Wblock "c:\123.dwg", ssEnd Sub<BR> 如果我想删除原有的图形,并且最后释放性质集 Sub test1()<BR>Dim ss As AcadSelectionSet<BR>Set ss = ThisDrawing.ActiveSelectionSet<BR>ss.Select acSelectionSetAll<BR>ThisDrawing.Wblock "c:\123.dwg", ss<BR>For Each i In ThisDrawing.ModelSpace<BR>i.Delete<BR>Next i<BR>ss.Clear<BR>ss.Delete<BR>End Sub<BR> Sub test1() Dim number As Integer
Dim ObjSelectionSet As AcadSelectionSet
i = 0
'获取当前图形中选择集的个数
number = ThisDrawing.SelectionSets.Count
'删除当前图形中所有的选择集
While i < number
Set ObjSelectionSet = ThisDrawing.SelectionSets.Item(0)
ObjSelectionSet.Delete
i = i + 1
Wend
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.ActiveSelectionSet
ss.Select acSelectionSetAll
ThisDrawing.Wblock "c:\123.dwg", ss
For Each i In ThisDrawing.ModelSpace
i.Delete
Next i
ss.Clear
ss.Delete
End Sub前面加上选择集的代码,我再想问一下飞狐兄,如果我想把前面的块,插到新的图形中(在同一文挡),怎么知道这个块的插入点?怎么实现。急用!
插入点0,0试试 如何知道当前图元的COUNT,
如何知道当前说选图形的Item(),怎么返回此对象 ThisDrawing.ModelSpace.Count当前图纸模型空间中的实体数目。
ThisDrawing.PickfirstSelectionSet当前选中实体所在的选择集。
如果只有选中一个实体,可以
Dim EntObj As AcadEntity
Set EntObj=ThisDrawing.PickfirstSelectionSet(0) efan2000发表于2004-6-1 17:26:00static/image/common/back.gifThisDrawing.ModelSpace.Count当前图纸模型空间中的实体数目。
ThisDrawing.PickfirstSelectionSet当前选中实体所在的选择集。
如果只有选中一个实体,可以...
<BR>我想说的如何知道自己所画的图元是ITEM,就是第几个
通过知道它是第几个,然后选定它,并返回做下面的MIRROR或其他操作 Sub test1() Dim number As Integer
Dim ObjSelectionSet As AcadSelectionSet
j = 0
'获取当前图形中选择集的个数
number = ThisDrawing.SelectionSets.Count
'删除当前图形中所有的选择集
While j < number
Set ObjSelectionSet = ThisDrawing.SelectionSets.Item(0)
ObjSelectionSet.Delete
j = j + 1
WendDim ss As AcadSelectionSet
Set ss = ThisDrawing.ActiveSelectionSet
ss.Select acSelectionSetAll
ThisDrawing.Wblock "c:\123.dwg", ss
For Each I In ThisDrawing.ModelSpace
I.Delete
Next I
ss.Clear
ss.Delete
End Sub上面这段代码怎么只能运行一遍,第二次就出现错误,文字运行到Set ss = ThisDrawing.ActiveSelectionSet提示出错了??
页:
[1]
2