jenuary
Guest
Thank you ninos19I just installed and tried the plugin...useful and especially works great!
congratulations on the great work.
Thank you ninos19I just installed and tried the plugin...useful and especially works great!
congratulations on the great work.
hello, to me does not add the rev unfortunately... help me to understand where this value loads the macro?perhcè perhaps in the declaration of the variable there is some incongruence! What am I supposed to check?hi to all, I share my macro to save the table in pdf and dxf adding the revision of the part/axis automatically
Hi, dani,hello, to me does not add the rev unfortunately... help me to understand where this value loads the macro?perhcè perhaps in the declaration of the variable there is some incongruence! What am I supposed to check?
I would also like to take the present value in the box of the component properties, which to me is called revision, and insert it into the exported file name. ..can it be that the set length of the name is insufficient to contain all characters? I mean the string:Hi, dani,
I review it as default property inside the part. In my case it is called "rev" and I put it with value "0.0".
My macro looks at the value of the property "rev" if it exists and if it is different from 0.0 then adds it in the name of the generated file.
in case you want to add the property in all files, here they added a very nice macro, that you have to customize.
Maybe I figured out why it doesn't work... we have custom properties in a folder on nas while the macro probably goes to take the value from the folder of solidworks locally. how could I map the correct file?Hi, dani,
I review it as default property inside the part. In my case it is called "rev" and I put it with value "0.0".
My macro looks at the value of the property "rev" if it exists and if it is different from 0.0 then adds it in the name of the generated file.
in case you want to add the property in all files, here they added a very nice macro, that you have to customize.
try to share a file part. because the properties relative to each part are or in it written.Maybe I figured out why it doesn't work... we have custom properties in a folder on nas while the macro probably goes to take the value from the folder of solidworks locally. how could I map the correct file?
I would also like to take the present value in the box of the component properties, which to me is called revision, and insert it into the exported file name. ..can it be that the set length of the name is insufficient to contain all characters? I mean the string:
filename = strings.left(filename, len(filename) - 7)
Thanks I will try right away, while I wanted to ask you if you can tell me from what file and in which folder the macro goes to read the rev value. I imagine it is the property of the document. Having set a file path different from default, having shared it on servers, this macro follows this edit or searches it in the installation files in the local directory?le parti in grassetto sono quelle che devi modificare, come si chiama la proprietà di revisione nei tuoi file e come è il valore zero che vuoi che non venga riportato nel nome. quella non è la lunghezza dei caratteri ma semplicemente cancella gli ultimi del filename, ovvero l'estensione.
___________________________
option explicit
dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
dim swdraw as sldworks.drawingdoc
dim swview as sldworks.view
dim swmodelref as sldworks.modeldoc2
dim getthatinfo as string
dim swmodeldocext as sldworks.modeldocextension
dim swexportdata as sldworks.exportpdfdata
dim boolstatus as boolean
dim boolstatuspdf as boolean
dim boolstatusdxf as boolean
dim draw as string
dim pdf as string
dim dxf as string
dim filename as string
dim lerrors as long
dim lwarnings as long
dim revisione as string
dim desc as string
sub main()
set swapp = application.sldworks
set swmodel = swapp.activedoc 'controlla che documento è aperto
if swmodel is nothing then
msgbox "no current document", vbcritical 'se è aperto un documento
end
end if
if swmodel.gettype <> swdocdrawing then 'se è di tipo messa in tavola
msgbox "this macro only works on drawings", vbcritical
end
end if
set swmodeldocext = swmodel.extension
set swexportdata = swapp.getexportfiledata(swexportpdfdata)
'aazeramento delle variabili di check
boolstatus = false
boolstatuspdf = false
boolstatusdxf = false
dxf = ""
pdf = ""
'recupera percorso e nome file con estensione
filename = swmodel.getpathname
'controlla se è stato salvato
if filename = "" then
msgbox "please save the file first and try again", vbcritical
end
end if
'save drawing / salva la messa in tavola
boolstatus = swexportdata.setsheets(swexportdata_exportallsheets, 1)
boolstatus = swmodeldocext.saveas(filename, 0, 0, swexportdata, lerrors, lwarnings)
if boolstatus then
draw = "ok"
else
draw = "failed"
end if
'prende la proprietà
set swdraw = swmodel
set swview = swdraw.getfirstview
set swview = swview.getnextview
set swmodelref = swview.referenceddocument
revisione = swmodelref.getcustominfovalue("", "rev"
'check if the rev variable is empty or is 0.0
filename = strings.left(filename, len(filename) - 7)
if reviewed0.0" and revisione <> "-" and revisione <> "" then
filename = filename & "_rev" & revisione 'append revision if not rev 0.0
end if
'save as pdf
filename = strings.left(filename, len(filename)) & ".pdf"
boolstatuspdf = swexportdata.setsheets(swexportdata_exportallsheets, 1)
boolstatuspdf = swmodeldocext.saveas(filename, 0, 0, swexportdata, lerrors, lwarnings)
if boolstatuspdf then
pdf = "ok"
else
pdf = "failed"
end if
'save as dxf
filename = strings.left(filename, len(filename) - 3) & "dxf"
boolstatusdxf = swexportdata.setsheets(swexportdata_exportallsheets, 1)
boolstatusdxf = swmodeldocext.saveas(filename, 0, 0, swexportdata, lerrors, lwarnings)
if boolstatusdxf then
dxf = "ok"
else
dxf = "failed"
end if
'message saved status
if boolstatus <> boolstatuspdf <> boolstatusdxf then
msgbox "save all successful" _
& vblf & "" _
& vblf & filename
else
msgbox "save as drawing failed" _
& vblf & "" _
& vblf & "sw draw:" & draw _
& vblf & "pdf: " & pdf _
& vblf & "dxf: " & dxf _
& vblf & "" _
& vblf & "error code:" & lerrors _
& vblf & "" _
& vblf & filename
end if
end sub
Good morning, everyone.
I attach Rel. 4.0 to savebackground, after so much expectation.
This version allows you to save files in different paths than the source file according to the modes you see in the attached image.
I have not yet entered the export in "stl" format as required sa xxfast, che salute.
Now we can define a rescue path on which our converted files will go, or automatically create sub folders based on the extension inside the file's residence manager.
remains always in foot the saving of the file in the path of origin as before, without under folders.
installation:
- as for previous versions extract the installation file from the .zip file and launch the program that will install automatically.
- in the case of previous installations in the pc will be overwritten automatically.
inside the zip file you will also find the updated guide.
I hope I was able to settle someone.
View attachment 52082
Okay.no it is not possible, you have to choose them from explore resources by uploading them into the list.
thank you very much jenuary....useful this macro, with a considerable saving of time.Good morning, everyone.
I attach Rel. 4.0 to savebackground, after so much expectation.
This version allows you to save files in different paths than the source file according to the modes you see in the attached image.
I have not yet entered the export in "stl" format as required sa xxfast, che salute.
Now we can define a rescue path on which our converted files will go, or automatically create sub folders based on the extension inside the file's residence manager.
remains always in foot the saving of the file in the path of origin as before, without under folders.
installation:
- as for previous versions extract the installation file from the .zip file and launch the program that will install automatically.
- in the case of previous installations in the pc will be overwritten automatically.
inside the zip file you will also find the updated guide.
I hope I was able to settle someone.
View attachment 52082
a macro should be created to connect to the saving event of the table. to save the macro export all pdf single according to your requests.I throw it there... a macro like this modified suit could export a drawing file consisting of many separate pdf sheets having each of them as file name the sheet name?
I don't know if I explained.
thanks in advance
so many hairs
ah here is interesting, before retiring then I will take a specific course, always if there is still such technology.a macro should be created to connect to the saving event of the table. to save the macro export all pdf single according to your requests.