- 积分
- 5987
- 明经币
- 个
- 注册时间
- 2006-7-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
- Private Sub Form_Load()
- Dim tempSet As AcadSelectionSet
- Set tempSet = mmm
- End Sub
- Function mmm() As AcadSelectionSet
- Dim Sset As AcadSelectionSet
- Set Sset = DrawingGB6170Front(1, 2)
- Dim pp(0 To 2) As Double
- pp(0) = 100: pp(1) = 100: pp(2) = 0
- For ii = 0 To Sset.Count - 1
- Sset.Item(ii).Rotate pp, 90 * 3.1415926 / 180
- Next ii
- Set mmm = Sset
- End Function
- Function CreateSelectionSet() As AcadSelectionSet
- Dim appAutoCAD As AutoCAD.AcadApplication
- On Error Resume Next
- Set appAutoCad = GetObject(, "AutoCAD.Application")
- If Err Then
- Err.Clear
- Set appAutoCad = CreateObject("AutoCAD.Application")
- End If
- appAutoCad.Visible = True
- Dim AcadDoc As AcadDocument
- Set AcadDoc = appAutoCad.ActiveDocument
- With AcadDoc
- On Error Resume Next
- If Not IsNull(.SelectionSets.Item("MySetSelectionSet")) Then
- Set CreateSelectionSet = .SelectionSets.Item("MySetSelectionSet")
- CreateSelectionSet.Delete
- End If
- Set CreateSelectionSet = .SelectionSets.Add("MySetSelectionSet")
- End With
- End Function
- Function DrawingGB6170Front(xDirection As Double, yDirection As Double) As AcadSelectionSet
- Dim CadEntity As New MyAcadEntity
- Dim objModelSpace As AcadModelSpace
- Set objModelSpace = CadEntity.objModelSpace
- NN = objModelSpace.Count - 1
- Dim tempCollection() As AcadEntity
- ReDim tempCollection(NN) As AcadEntity
- Dim Sset As AcadSelectionSet
- For ii = 0 To objModelSpace.Count - 1
- Set tempCollection(ii) = objModelSpace.Item(ii)
-
- Set Sset = CreateSelectionSet
- Next ii
- Sset.AddItems tempCollection
- Set DrawingGB6170Front = Sset
- End Function
|
|