gtsolid
Guest
hi to allI have this fragment of macro that turns the parts into pdf, dwg and step.
As for the transformation in step I have problems only in case I have "." in the file name.
What do you think is the problem? I didn't find anything out of place at first.
As for the transformation in step I have problems only in case I have "." in the file name.
What do you think is the problem? I didn't find anything out of place at first.
Code:
'pdf & dwg & step: generate step ---------- (load part within same name, save step, close part) ---------
if myvalue = "4" or myvalue = "8" then
filen1 = strings.left(filename, len(filename) - 4) & ".sldprt" 'full path + filename + .sldprt
set swapp = application.sldworks
set swmodel = swapp.activedoc
set selmgr = swmodel.selectionmanager
set swmodel2 = swapp.opendoc6(filen1, 1, 0, "", longstatus, longwarnings)
swapp.opendoc6 filen1, 1, 0, "", longstatus, longwarnings
swapp.activedoc.activeview.frameleft = 0
swapp.activedoc.activeview.frametop = 18
swapp.activedoc.activeview.framestate = 1
filen2 = right(filename, len(filename) - len(workdir))
filen2 = strings.left(filen2, len(filen2) - 4)
set swmodel2 = swapp.activatedoc2(filen2, false, longstatus)
filen3 = strings.left(filen1, len(filen1) - 7) & ".step" ''full path + filename + .step
boolstatus = swmodel2.extension.saveas(filen3, 0, 0, nothing, longstatus, longwarnings)
set swmodel2 = nothing
swapp.closedoc filen2
if boolstatus then
if singlefile = true then msgbox filen3, vbinformation, "file salvato con successo -step-"
else
msgbox filen3 & vbnewline & lerrors, vbcritical, "salvataggio fallito, codice errore: -step-"
end if
end if