Hi all
I'm looking for a way to save the file name of an open MEP on the screen automatically with a macro like this:
Origin: xxxxxx.slddrw to xxxxxx-DXF.slddrw
in fact: add -DXF at the end of the filename and before the extension
Meci of your help
Hi all
I'm looking for a way to save the file name of an open MEP on the screen automatically with a macro like this:
Origin: xxxxxx.slddrw to xxxxxx-DXF.slddrw
in fact: add -DXF at the end of the filename and before the extension
Meci of your help
Hello here it should do the trick
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
Hello
And thank you for looking into my problem which is not so simple.
In fact, I generate 6 files for a sheet metal part and I try to automate as many manipulations as possible to save time:
Part.SLDPRT > 3D SLDW Part
SLDDRW Definition Part.SLDDRW > MEP
Pièce.PDF > Definition MEP for printing without SLDW (method check and workshop)
Part-DXF.SLDDRW > MEP of unfolded sheet metal scale 1 (taken from the unfolded state of Part.SLDPRT)
Pièce-DXF.PDF > Unfolded sheet metal MEP ech 1 for printing without SLDW (methods and workshop)
Part-DXF.DXF > Generated at scale 1 for laser cutting programming, hiding bend lines and dimensions. (methods and workshop)
That's the rundown.
Do you have another macro proposal?
Thank you again for your help.
Fifi69
Do you want a macro that generates everything for you or only PDF and DXF exports?
It's super nice but a macro to save a file by putting -dxf will be enough for me.
I already have a macro that integrates2 other 1 to hide the lines (sketch), and 1 to hide dimensions and notes (layers)of folding to then save in . DXF
the PDF and DXF recording features of solidworks are enough for me.
If you have time to go further, OK otherwise I don't want to overdo it.
For this you may need my attached template files?
Thanks again
FIFI69