Adding a prefix to my dynamo print script based on yes or no

Adding a prefix to my dynamo print script based on yes or no

kebba88L69
Explorer Explorer
156 Views
1 Reply
Message 1 of 2

Adding a prefix to my dynamo print script based on yes or no

kebba88L69
Explorer
Explorer

Hi, I have currently got a dynamo script that batch prints sheets, in it I've  manged to add nodes which add the prefix "REV" (for revision) to the filename when I print however i was wondering how do i go about having the prefix "REV" in the filename  ONLY if the sheet has a revision, I know Boolean will be involved somewhere but I'm not sure on how to go about it. Pic of my script added below.

Thanks  AUTOMATED BATCH PRINT_2023-11-02_02-57-59.png 

0 Likes
157 Views
1 Reply
Reply (1)
Message 2 of 2

GaryOrrMBI
Collaborator
Collaborator
1) Know that I don't do Dynamo,
2) Even if I did do Dynamo the pic that you posted is too small to read clearly,
3) Even if I could read the text in the image that wouldn't help in figuring out what code is behind the nodes to be able to suggest where to insert the following but,

Conceptually:
A ViewSheet has a Method called GetCurrentRevision which will either return the ElementId of the current revision on the sheet or InvalidElementId if there are no revisions on the sheet.
It looks like you are using the parameter "Current Revision" to get that value. That parameter will return a reference to a specific Revision or it will return a value indicating that the sheet doesn't have any revisions.

What you need now is an "If" statement between the collection of the value and writing the prefix:
If Revision value = invalid element (or empty string, or whatever you are getting returned from your code block),
then
the prefix should equal an empty string,
otherwise
the prefix should equal whatever string you are currently creating as the revision prefix.

-G
Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes