嗨,伙计,谢谢你给我的合作,直到现在,请有人知道,如果有可能作出一个选择集的两个不同的块在绘图中的VBA。
我写了这段代码,当然它是有效的,因为我创建了两个不同的选择集,但如果我想只有一个选择两个不同的块?有办法吗?
- GV(0) = "INSERT"
- '---------------------------------------------------
- 'Revise the block name "tendnum1" for your application
- GV(1) = "X1-O-180"
- intCode(0) = 0
- intCode(1) = 2
- '---------------------------------------------------
- ThisDrawing.SelectionSets.Add ("BOM")
- Set Ssnew = ThisDrawing.SelectionSets("BOM")
- Ssnew.Select acSelectionSetAll, , , intCode, GV
-
- GV(1) = "F44500-HD-D-48504Rev0a"
-
- ThisDrawing.SelectionSets.Add ("MySS")
- Set Ssnew1 = ThisDrawing.SelectionSets("MySS")
- Ssnew1.Select acSelectionSetAll, , , intCode, GV
-
-
- For Each Entity In Ssnew
- Array1 = Entity.GetAttributes
- Set BlocK = Entity
- X = BlocK.InsertionPoint(0)
- Y = BlocK.InsertionPoint(1)
- Z = BlocK.InsertionPoint(2)
- HAN = BlocK.Handle
- ....
- Next
- For Each Entity In Ssnew1
- Array2 = Entity.GetAttributes
- Set BlocK = Entity
- X1 = BlocK.InsertionPoint(0)
- Y1 = BlocK.InsertionPoint(1)
- Z1 = BlocK.InsertionPoint(2)
- HAN1 = BlocK.Handle
- ....
- Next
非常感谢。 |