- Option Explicit
- Dim swApp As SldWorks.SldWorks
- Dim swModel As SldWorks.ModelDoc2
- Dim FromPage As Integer
- Dim strCurrentSheet As String
- Dim strSheetNames() As String
- Dim SheetCount As Long
-
- Sub main()
- Set swApp = Application.SldWorks
- Set swModel = swApp.ActiveDoc
- strCurrentSheet = swModel.GetCurrentSheet.GetName
- strSheetNames = swModel.GetSheetNames
- SheetCount = swModel.GetSheetCount
- For FromPage = 1 To SheetCount
- If strCurrentSheet = strSheetNames(FromPage - 1) Then
- swModel.PrintOut2 FromPage, FromPage, 1, False, "", 1, False, ""
- Exit Sub
- End If
- Next
- End Sub
复制代码 有几人感兴趣
|