Dim swApp As Object
Dim Part As Object
Dim longstatus As Long, longwarnings As Long
Dim File As String
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
' ajout controle du bon fichier
If Part Is Nothing Then
MsgBox "Aucun fichier n'est actuellement ouvert."
Exit Sub ' If no model is currently loaded, then exit
End If
' Determine the document type. If the document is a drawing, then send a message to the user.
If (Part.GetType <> 3) Then '1Part 2Assembly 3Document
MsgBox "Cette macro ne s'applique que sur une mise en plan"
Exit Sub
End If
File = Part.GetPathName
If File = "" Then
MsgBox "Cette macro necessite que le fichier soit préalablement enregistré"
Exit Sub
End If
FilePath = Left(File, InStrRev(File, "\"))
FileName = Mid(File, Len(FilePath) + 1, Len(File) - (7 + Len(FilePath))) & "-DXF"
longstatus = Part.SaveAs3(FilePath + FileName + ".SLDDRW", 0, 2)
End Sub
To bardzo miłe, ale wystarczy mi makro do zapisania pliku poprzez wpisanie -dxf.
Mam już makro, które integruje2 inne 1 do ukrywania linii (szkic) i 1 do ukrywania wymiarów i notatek (warstw) składania, aby następnie zapisać w . Format DXF
funkcje nagrywania PDF i DXF w solidworks są dla mnie wystarczające.
Jeśli masz czas, aby pójść dalej, OK, w przeciwnym razie nie chcę przesadzić.
Do tego mogą być potrzebne załączone przeze mnie pliki szablonów?