system
April 1, 2015, 10:32am
1
Hello
I would like to be able to export a part or assembly in X_T by clicking only a button on Solidworks 2010?
I've already found a button like this to do an export in .pdf and .dxf at the same time for my plans that works very well.
But I can't find it to export to X_T?
Thanks in advance
pl
April 1, 2015, 10:41am
2
Just change the macro, do you know VBA programming?
See this link:
http://forum.solidagora.com/macro-api-solidworks-enregistrer-pdf-dxf-x-t101.html
system
April 1, 2015, 10:50am
3
No, I don't know the VBA program at all.
The link you sent me is to save the elements of a file.
I would like a button that would make it look like I did "File/save as/" and save in Parasolid x_t
gt22
April 1, 2015, 10:55am
4
See this link
Parasolid Macro Export
http://www.3dcontentcentral.fr/macros/macro.aspx?id=557249
https://www.dropbox.com/s/l5vscy9dkpswb1i/PARASOLID.bmp?dl=0
@+;-))
remrem
April 1, 2015, 11:06am
5
Hello
To start a macro it is often interesting to use the recorder. This will allow you to know the useful functions.
Then it is possible to deepen by looking for the targeted elements in the help: http://www.solidworks.fr/sw/support/1835_FRA_HTML.htm
Because what's interesting is above all to understand what you're coding and not just copying a code found here or there. But of course it requires a little patience and time.
Kind regards.
3 Likes
system
April 1, 2015, 11:53am
6
gt22 I've tried this macro before but it doesn't work.
gt22
April 1, 2015, 11:57am
7
This is a 32/64 bit version issue
The problem of iff or if
Post the macro to check if it's working properly or not
@+;-))
system
April 1, 2015, 11:57am
8
I just redownloaded it to try it and it puts me:
1 Like
system
April 1, 2015, 12:06pm
10
yes, actually I made a piece and then I saved it somewhere and then I press the button or I associated the macro but it shows that.
Maybe that's not how we should use it. But I have another one that works like this to save in .pdf and .dxf and that works well
pl
April 1, 2015, 12:09pm
11
It is well written (we can't see very well):
If Part.GetType = swDocDRAWING Then
Are you running the macro from a part in SolidWorks?
1 Like
system
April 1, 2015, 12:11pm
13
yes I started the macro from a coin
system
April 1, 2015, 12:14pm
14
In fact, I don't know if that's how to use it, nothing indicates how to do it?
system
April 1, 2015, 12:19pm
15
I found this on another post, I did it, it works exactly as I want!!
I put the file "save_x_t.swp" as an attachment for those who want it.
Sub Sauvegarde_X_T()
Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim Locatie As String Dim Locatie_aangepast As String Dim OpenDoc As Object Dim Extensie_nieuw As String Dim Extensie_oud As String Dim retval As String Dim Naam As String Dim Naam_aangepast As String
Set swApp = CreateObject("SldWorks.Application") Set swModel = swApp.ActiveDoc Set OpenDoc = swApp.ActiveDoc()
Extensie_oud = ". SLDASM" Extensie_nieuw = ". X_T" Locatie = OpenDoc.GetPathName Locatie_aangepast = Left(Locatie, Len(Locatie) - 7) retval = Dir$(Locatie_aangepast & Extensie_oud) Naam = Dir$(Locatie) Naam_aangepast = Left(Naam, Len(Naam) - 7) Titel = OpenDoc.GetTitle Titel = Left(Titel, (Len(Titel)))
' If retval = Naam Then 'nRetval = swApp.SendMsgToUser2(Naam_aangepast & " DXF created !!! ", swMbWarning, swMbOk) ' End If Set Part = swApp.ActiveDoc longstatus = Part.SaveAs3(Naam_aangepast & Extensie_nieuw, 0, 0)
End Sub
save_x_t.swp
2 Likes
system
April 1, 2015, 2:06pm
16
I also put you the x_t.bmp icon I made.
x_t.bmp
system
April 2, 2015, 5:55am
17
I'm putting back the latest version of the corrected macro to save in X_T with the X_T logo that goes with :)
Have a good day everyone!!
save_x_t.zip