Hi everybody! I’ve lurked on here for a while but this is my first ever post!
I am attempting to place drafting views on sheets and I am stumped. The drafting views are not empty, my list lengths match, I’ve tried several different nodes but keep coming back to Viewport.Create out of the Rhythm package. I keep getting the error “View suchandsuch cannot be added to the sheet because it is already on another sheet.” Except, it isn’t on another sheet.
It’s a mix. Some are already made, some are made in the graph if other conditions are met. I’ve tried testing it where all are made already, or it is generating all of them.
This is my graph. Excuse how drawn out it is, work in progress. It is designed to take information from a linked file, and two .txt files “Sheets” and “Views” which are meant to be read in as dictionaries, with the keys corresponding to the linked document element IDs, and the values corresponding to the open document IDs It also writes to a .txt called “Errors.”
On the first run, it will check to see if the .txt files are empty. If they are, which they will be if it has never run before, it will create a dictionary where the linked model elements are read in as values, and the keys are set to “void.” It will then create elements in the current document to match the keys and replace the void values. finally it will write an updated version back to the .txt.
On subsequent runs, the .txt files will now have data in them. No longer empty, the graph will read them in as dictionaries and check to see if they match the dictionary from the linked document. If there are new keys (new views and sheets) it will create new views in the current document to match. If keys have been deleted, it will alter the appearance of the corresponding view and write to Errors.txt telling you what has been orphaned.
Effectively, I can’t get past the first run, because I can’t get the newly created views to place on the newly created sheets.
That graph sounds like it has a lot going on, which is awesome, but I may suggest you break it out into a couple different ones to simplify runtime, but also error handling / finding. I have built very complicated graphs like this in the past, and often break them apart once I get past proof of concept. Not a requirement, but a suggestion none the less.
Also, any chance you could also share a stripped version of the model your working with so we can be running the graph against the same data set?
Are you trying to get the Title Block Type that the sheet has on it? If so, I think you should try this to start with because right now it looks like you are filtering two unrelated lists with the same bool filter.
One more general comment is that it appears you are using ElementId for your dicts to compare, but please note that ElementIds are not static and often can change especially in a workshared environment. It would be safer to use the UniqueId of the elements as those are static.