Make Title Box Label to "File Name"

Make Title Box Label to "File Name"

pe_simon
Advocate Advocate
1,246 Views
6 Replies
Message 1 of 7

Make Title Box Label to "File Name"

pe_simon
Advocate
Advocate

Hi , how to made  a Label parameter is only show "File Name", not File Path? Thanks.

 

pe_simon_0-1709027290821.png

 

0 Likes
Accepted solutions (1)
1,247 Views
6 Replies
Replies (6)
Message 2 of 7

iainsavage
Mentor
Mentor

Not sure but why would you want the Sheet name to be the file name - do you only have one sheet in each project (file)?

0 Likes
Message 3 of 7

pe_simon
Advocate
Advocate

yes. for example my drawing number is TS/FD/001 on sheet. But my file name is TS_FD_001.rvt. 

I want shown it on print out. And the actual file name is easy for search. 

0 Likes
Message 4 of 7

ToanDN
Consultant
Consultant

Why can't you change your drawing number to match your file name?

0 Likes
Message 5 of 7

iainsavage
Mentor
Mentor

@pe_simon wrote:

yes. for example my drawing number is TS/FD/001 on sheet. But my file name is TS_FD_001.rvt. 

I want shown it on print out. And the actual file name is easy for search. 


So you're creating a different Revit model for each individual drawing?

That's weird unless they are extremely small and simplistic projects.

0 Likes
Message 6 of 7

iainsavage
Mentor
Mentor

You could probably do it with Dynamo but it would involve getting the value of the File Path and then truncating the string and sending the result to another parameter - and then how would you know how many characters to truncate by, would it be the same every time?

Seems like a lot of hassle for just one sheet per file so personally I would do as @ToanDN suggests.

0 Likes
Message 7 of 7

iainsavage
Mentor
Mentor
Accepted solution

I've done a Dynamo script which seems to work.

YOU will need to:

  • add a shared parameter to your title block family and use that as the label. Reload into your project(s) and template and choose to overwrite parameter values.
  • in the project/template edit the Project Parameters to add the SAME shared parameter to your project(s) and template file
  • in Project Parameters associate the shared parameter to PROJECT INFORMATION (NOT Sheets) - project information can appear on multiple sheets, but sheet information must have unique values for each sheet so that won't work properly.
  • edit the dynamo script to put YOUR shared parameter name into the code block at top middle
  • edit the String.Split node to get the correct number of levels for YOUR path name
  • edit the two String nodes as necessary to correctly divide the path
  • edit the code block at bottom right to get the last index of your string list
  • Auto run or manually run the script.

iainsavage_0-1709116404594.pngiainsavage_1-1709116447480.png

 

Good luck. Come back if it doesn't work.

0 Likes