|
- Private Sub del20170529()
-
- Dim Xls As Excel.Application, Rng As Range
- Set Xls = GetObject(, "Excel.Application")
- Set Rng = Xls.Selection
- Dim Arr, Str1
- Str1 = Join(Xls.WorksheetFunction.Transpose(Rng), ",")
- Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2
- Set SwApp = Application.SldWorks
- Set SwModel = SwApp.ActiveDoc
- Dim SwDraw As DrawingDoc
- Set SwDraw = SwModel
- Dim SwDispDim As DisplayDimension, SwDim As Dimension
- Dim Anns, SwAnn As Annotation
- Anns = SwDraw.InsertModelAnnotations3(0, swInsertDimensionsMarkedForDrawing, True, True, True, False)
- Dim SwView As View, Str
- Set SwView = SwDraw.GetFirstView
- Set SwView = SwView.GetNextView
- Do While Not SwView Is Nothing
- Set SwAnn = SwView.GetFirstAnnotation
- Do While Not SwAnn Is Nothing
- Set SwDispDim = SwAnn.GetSpecificAnnotation
- Str = SwDispDim.GetDimension.FullName
- ''
- Str = Left(Str, InStrRev(Str, ".") - 1) & "@" & SwView.Name
- If InStr(Str1, Str) = 0 Then
- 'SwAnn.Select True
- SwAnn.Visible = swAnnotationHidden
- End If
-
- Set SwAnn = SwAnn.GetNext2
- Loop
- Set SwView = SwView.GetNextView
- Loop
- Stop
- End Sub
复制代码
'***************
|
|