Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim swApp As SldWorks.SldWorks
- Dim swDoc As SldWorks.ModelDoc2
- Dim swExt As SldWorks.ModelDocExtension
- Dim swCustProp As CustomPropertyManager
- Dim filename As String
- Dim newNamePDF As String
- Dim newNameDWG As String
- Dim fnameLen As Long
- Dim result As Boolean
- Dim error As Long
- Dim warning As Long
- Dim bool As Boolean
- Dim val As String
- Dim revision As String
- Sub main()
- Set swApp = Application.SldWorks
- Set swDoc = swApp.ActiveDoc
- Set swExt = swDoc.Extension
- Set swCustProp = swExt.CustomPropertyManager("")
- bool = swCustProp.Get4("Poprawka", False, val, revision)
- 'Debug.Print "Get custom prop result: " & bool
- 'Debug.Print "Custom prop value: " & revision
- filename = swDoc.GetPathName()
- fnameLen = Len(filename)
- 'newNamePDF = Left(filename, fnameLen - 7) & "_" & revision & ".pdf"
- 'newNameDWG = Left(filename, fnameLen - 7) & "_" & revision & ".dwg"
- newNamePDF = Left(filename, fnameLen - 7) & ".pdf"
- newNameDWG = Left(filename, fnameLen - 7) & ".dwg"
- result = swExt.SaveAs3(newNamePDF, 0, 0, Nothing, Nothing, error, warning)
- 'Debug.Print result, error, warning
- result = swExt.SaveAs3(newNameDWG, 0, 0, Nothing, Nothing, error, warning)
- 'Debug.Print result, error, warning
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement