Error Creating Viewports

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.

Thank you for the help!

I should say, eventually I will want this script to move the drafting views from one sheet to another if the sheet at the corresponding index changes.

Try using a Transaction.Start node after the Transaction.End and see if that helps. Are the views being created in this graph, or already made?

Thanks Sean! Does not appear to help.

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.

1 Like

Just tried to upload the file, but I’m too new of a user :confused:

Hello Kira,

If you encounter such a problem let´s get a few steps back and look if placing a drafting view is even working.

Works for me. Is that working for you with one of your drafting views?

Here is a simple filesharer that you can use to share your file:
WeTransfer

Hi Kira,

How many points do you have as input?
If you have one point try to set lacing to longest

Bumped your trust level so you should be able to post files.

If not, you can utilize another web service, such as onedrive, box, Dropbox, google drive, etc.

2 Likes

Thank you!

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.

1 Like

Callout Management.dyn (439.7 KB)

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.
image

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.

1 Like

Ah, thanks Sean, that is a great comment. Let me strip these couple models back and I can upload them.

1 Like

Here is the Graph, updated to run on UniqueIDs, and a stripped current document.

Callout Management.dyn (450.1 KB)

DYNAMO - CURRENT DOCUMENT.rvt (5.1 MB)

1 Like

And the linked model.

DYNAMO - LINKED MODEL.rvt (6.4 MB)

1 Like

So, I think I got it figured out.

  1. You need to make sure the drafting views aren’t empty. (See Snip below)

  1. You were feeding it the sheets from the link model, not the newly created sheets

I would also suggest you resolve the Title block coming from the linked file to make sure the correct one is being used in the current model.

3 Likes

Thank you Sean!!! That did the trick!

1 Like