Background Documents SaveAs Help (File Management)

Hello,

I am trying to do some dynamo file management where I have the option to Audit, Purge, detach and compact files. I am trying to put it all in one script which is a fairly ambitious goal, but I think I’m getting close.

The rhythm nodes that I am using can only process one file at a time, therefore I am attempting to use a LoopWhile node iterate through each file. I don’t fully understand the functionality of this node and I am getting the “A cyclic dependency exists between two variables” warning.


What am I missing on the LoopWhile node?

Downloads:
Graph: FileManagement.dyn (37.7 KB)
Custom SaveAs node: SaveAsDocInput.dyf (14.7 KB)

Additional notes:

  • I need the rhythm nodes to “power through” any opening warnings that might show up so that it wont stop running when arbitrary warnings show up.

  • What node/package would you guys suggest for purging?

-Thanks

EDIT: This looping did not end up working

I fixed the looping by just using a python for loop instead of the LoopWhile node. It is probably what I should have started with actually.

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

init = IN[0]
items = IN[1]
index = init

while index < items-1:
index = index + 1

OUT = index

Now I just need to figure out:

  1. How to use the clockwork SaveAs node on specific documents, in this case the ones that I have opened in the background.
  2. How to get the Rhythm Open node to skip over the opening warnings like .csv incompatible
  1. I believe there is an issue here with that purge node. Where did that come from and what is the error?
  2. Suppressing warnings in my Rhythm node is not happening. If your document has warnings or issue, your going to see them. Sorry. :confused:

I also want to point out that my nodes are not going to be the easiest thing to add looping to as this is how dynamo behaves. When you fulfill the inputs, it’s going to just run on all of them. Resulting in all the documents being opened at once. That’s definitely fixable when you make your workflow all in one node (c#) or python and implement looping. I’ve actually done this with my family upgrade node.

Thanks for responding @john_pierson ,

A few things have changed…


*The warnings are from the null values
FileManagementOrchid.dyn (33.2 KB)

I’m trying the Orchid equivalent of your nodes, and they seem to work with lists of files until you get to the last item for some reason. In which case they save the document you used to open dynamo with over the last document.

It is worth noting that these nodes don’t end up saving anything until the whole script is done running so you can easily run into scalability issues.

Do you think shoving everything to the right of “Directory.Contents+” into a custom node will get it to run for each list item?

Do you think something like this:


will work for warnings that occur when a Revit file is opening?

-Thanks

For the warnings in a Revit file: I’m aware of how to suppress them and have done so with addins quite a bit. However, some are in fact not dismissable. In dynamo, it is very difficult to subscribe to events, so I won’t be spending time implementing that kind of workflow in Dynamo nodes as it becomes unpredictable very quickly. (As you are seeing with some of the nodes you are using now)

In regards to the orchid nodes. My nodes won’t be compatible with his as I am storing the documents in a more stable way. See this post for details, Copy Views to Document on file

If you are using any orchid nodes, I would say you stick with that package and not mix the two. If you have issues with those nodes that would be reported through his GitHub.

1 Like

Thanks for your feedback,

Do you think it is possible to run your nodes on a list of files through a custom node, because they do seem to be more stable but they require a single file path input.

I guess I’ll have to find some other way to get rid of those warnings maybe an escape key macro or something like that :sweat_smile:.

Let me try to investigate a bit more. (no guarantees I can get to this soon :disappointed:)
I am thinking you can possibly wrap your workflow in a custom DYF and then loop it like the Dynanimator package from the bad monkeys. https://github.com/BadMonkeysTeam/Dynanimator

1 Like

I thought about using dynamo automation, using the purge node for the opening options and then a normal slave graph for the saveAs options, however then I could not audit the files because he unfortunately didn’t include audit in journal.cs’s zero touch node constructor :confused:
image


From: