Printing to a custom filename when creating SEPARATE files.

Printing to a custom filename when creating SEPARATE files.

Anonymous
Not applicable
3,127 Views
5 Replies
Message 1 of 6

Printing to a custom filename when creating SEPARATE files.

Anonymous
Not applicable

Hi, 

 

I am printing a bunch of sheets to pdfs trying to customize the names of the sheets I am printing to. This is easy printing to a combined file as I am able to use the printmanager.PrintToFilename property. However when printing to seperate files revit prints the files with the title of the document as a default printing name of sorts.

 

I can't find anything in the revit api that will let me do this, Can someone please help point me in a direction or let me know if this is possible?
The only solution i can think of is to temporarily modify the view title and swap it back in after printing but my employer doesnt think its a good idea.

 

Thank you

Jack


Accepted solutions (1)
3,128 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Jack,

 

I am not sure whether other better solutions exist.

 

Temporarily modifying the view title sounds perfectly viable to me.

 

You can reassure your employer that if you do this within a temporary transaction that is never committed, no changes will ever be wrtitten permanently to the model.

 

Another option would be to print out the files to the default names chosen by Revit and then run an external standalone utility to rename them to whatever you would prefer.

 

That would interfere with the model even less.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6

Anonymous
Not applicable

Thanks a million Jeremy,

I will talk to him about it, this should help. He also knows you are a very trustworthy source so I would say it will.

Regards,

0 Likes
Message 4 of 6

aricke59
Enthusiast
Enthusiast

Hi Jack, even though its a long time since your question this was something that I had battled with for quite a long time.

 

In the end it proved to be a simple solution in as much as

 

1. You need to set your isCombinedFile to true

2. Set printtofile to true

3. Set your PrintToFileName to the name you want.

 

You then just need to iterate over the views, printing each one as you go, and changing the output file name as you go.

 

I had referenced "printtofile" but setting it to true would never stick until I set the "isCombinedFile" to true. There were never any error messages when setting printtofile to true, it simply would not stick. This meant the file created would always be the default Revit output file name (which changed).

 

The help file also makes no mention that you must set "isCombinedFile" to be able to use "printToFile" = true.

Message 5 of 6

Anonymous
Not applicable

 


@aricke59 wrote:

Hi Jack, even though its a long time since your question this was something that I had battled with for quite a long time.

 

In the end it proved to be a simple solution in as much as

 

1. You need to set your isCombinedFile to true

2. Set printtofile to true

3. Set your PrintToFileName to the name you want.

 

You then just need to iterate over the views, printing each one as you go, and changing the output file name as you go.

 

I had referenced "printtofile" but setting it to true would never stick until I set the "isCombinedFile" to true. There were never any error messages when setting printtofile to true, it simply would not stick. This meant the file created would always be the default Revit output file name (which changed).

 

The help file also makes no mention that you must set "isCombinedFile" to be able to use "printToFile" = true.


Omg...i spent a day trying to find the solution.....you are star......

 

Setting iscombined to true and iterating each view individually is the key....

 

Thanks a ton for taking the effort to post the solution..

0 Likes
Message 6 of 6

Anonymous
Not applicable

Thanks for your reply, It works and I think it should be accepted as a solution of this issue. 

I still need to find out how to change the file address.

Thanks again.

 

0 Likes