• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

macro x pdf

  • Thread starter Thread starter BOSCO '71
  • Start date Start date

BOSCO '71

Guest
Sorry I tried to do a research but I didn't find what I need...

in my company it has decided to create a parallel archive in .pdf format to facilitate the use of files in safety by the various entities (purchase, commercial etc... )

If the destination folder is always the same it would not be possible to create a button "Save pdf" which allows me with a click to avoid "Save by name" select pdf and give it the way to save it??? ?

thanks for any interest.
 
go to c:\programs\solid edge stxxx\custom\batch\bin and you will find batch.exe. It should be enough to do what you want.
Hi.
 
you are right and the batch.exe file I have already used it to transform, using a pdf printer, files that were already in archive.
now I would need a button so that all the times I create a new .dft besides saving it obviously as dft can with a command save it directly as .pdf in a specific folder so as to automate the saving of the current file.

I hope I've been clear. . .

Hi.
 
Don't you want to use power toys?
much more flexible, with a click you print everything you want.
 
Hey, did you find the solution to your problem? I also have the same need and I would be interested in such a system.
 
Hey, did you find the solution to your problem? I also have the same need and I would be interested in such a system.
should be something like this:
Code:
dim objapp as solidedgeframework.application
dim objdft as solidedgedraft.draftdocument

dim nome as string

sub main()

    set objapp = getobject(, "solidedge.application")
    set objdft = objapp.activedocument
    
    nome = (left(objdft.fullname, len(objdft) - 3)) + "pdf"
    
    call objdft.saveas(nome)
    
    set objdft = nothing
    set objapp = nothing

end sub
remember to add references to:
solidedge draft type library
solidedge framework type library
 
Hello be_on_edge,

I assume that the "code : "
that you indicate it serves to create a macro, but at the same time I have no familiarity in this sense having never created macros...
Could you give me some more information on how to proceed in this sense?

thanks:confused:
 
Hello be_on_edge,

I assume that the "code : "
that you indicate it serves to create a macro, but at the same time I have no familiarity in this sense having never created macros...
Could you give me some more information on how to proceed in this sense?

thanks:confused:
He's already talked about it in the past.

Do a recircle:biggrin:

Otherwise, I'll do it for you, and I'll put it here as an attachment.

Hi.
 
be_on_edge: there was a small error in your code (len on the file object and not on the name ;-p)

I did macro using be_on_edge code:
- the dft is saved
- a copy is saved in pdf

You can then add the button to the quick access bar.

the code is not compiled: is written in wsf language (windows script file)

and it is easy to consult and make small changes with notespad++ (select vb language)

can be launched directly the wsf file, or given unexpert users don't make it, then I created a exe that launches the wsf with the same name in the same folder
(nb: the exe does not find the wsf on the network paths, but only on the routes starting type with e:\...; c:\.... etc... ) if you want to map macros on the server, you need to map the network path as 'network unit'

edit: deleted attachment, for updated version go here:
http://www.cad3d.it/forum1/showthread.php?24486-macro-x-pdf&p=288238&viewfull=1#post288238
 
Last edited by a moderator:
Hello vespa_83
Thank you

Sorry I didn't answer you right now, but I was gone for work. . .

I tried your macro and it works just as it serves me
If you can help me again, I'll be grateful.

when the file already has a .dft name by launching the macro with a button you create the corresponding file.pdf , but when the file is a new .dft , i.e. a new table, selecting directly the macro asks me the name for the .dft and where to save it but does not create the corresponding .pdf
i.e. saves a file " drapdf " without extension.

I hope I explained.

my intention is to replace the "Save" button with this macro so as to automate, even for my colleagues, the usual save with the creation of the corresponding .pdf file especially for new files.

Now it would be enough first to save by name and then to launch the macro but this does not give me the assurance that all designers remember to do this.

Thanks again
Hi.
 
apri save+pdf.wsf con notepad / notepad ++

riga 35:
da così:
nome = (left(objdoc.fullname, len(objdoc.fullname) - 3)) + "pdf"

call objdoc.save ' normale
call objdoc. Betances(nome) 'sava con nome

a così:
call objdoc.save ' normale

nome = (left(objdoc.fullname, len(objdoc.fullname) - 3))

call objdoc. Betances(nome + "pdf") 'Sava by name


I moved "pdf", so those who have different needs (save multiple formats, different) can better change the source code.

on the speech to replace the normal save are not entirely agreeing: I every 20 minutes and after every change went to good end except, if on a drawing I am 3 hours, it is useless to save and overwrite the 'pdf' 20 times , then I would see it better as a kind of final action release, modification, etc... , then you see, if the slowdown is not significant. . .
 
Hello vespa_83

Sorry again for the delay but it's such a time...

I managed, thanks to your advice, to create the macro tailored to my needs and works at the great :finger: both for new files and for existing files.

thanks and hello
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top