View.SetCropBoxCurves Dosnt work for floor plan views

Hi, can anyone give me a hand? My script used to work but for some reason it seems to be failing at View.SetCropBoxCurves now. I’ve figured out it has stopped working for floor plan views. Possibly due to some code change in Revit 2019?

image

seems to work with multiple views going in

Have you tried changing the list levels? It kind of looks like a lacing issue as L3 should be a list of a list of curves, instead of just a list of curves. Honestly, I don’t know how that custom node works but the input structure seems odd.

I would expect the node to want a single level list of views and then a list of curves per view. Can you drop a small revit file and dyn? Might be easier to troubleshoot.

Thanks Kenny, its a pretty cluttered script. Which makes it annoying to use unless your using it for a few fair few well named sheets and views

Using with dynamo 1.33. Just need to create one sheet with one view to duplicate which gets a null with the node. But then 2 or more views on multiple sheets works. Its very particular about naming with string replace

Sheets_Duplicate With Views.dyn (92.9 KB)

Which package does the node come from? It might be easier to sort out the inputs first instead of changing the list levels of the custom node.

It is from MEPower

I went through the python code in the node and it has a function to turn inputs into lists if they aren’t but they are expecting the lowest level lists you can.

Unfortunately I don’t have Dynamo 1.3 installed at the moment but I think your problem can be solved using 2 flatten nodes before the input. I guessed what the structure might be like in both single and multiple views but the same flatten nodes work for all.

1 Like

its not quite there. I think I know why I set it up ages ago like I did. Because you want the right views on the right sheets when you have multiple, which you loose if you flatten the view list…

duplicated this…
image
Got this…
image

Just the first sheet packed with views.

Need this structure retained some how for putting views on sheets down the track
image
image

I may actually have a python script you wrote me that does this!

1 Like

Are you talking about the script that copies the list structure? That might be a better solution for this situation. There are a lot of nodes that don’t react the best way with nested nested lists so a flatten and ‘unflatten’ tends to be a good workaround.

1 Like

boom! thanks

1 Like

better actually test it’ll work with one view one sheet…

nup
image

That’s strange. The inputs seem fine and the script in the node accept them just fine. Maybe try deleting the node and putting a new one back in or restart Dynamo.

After pulling my hair out for hours. The View.SetCropBoxCurves is not working with plan views! Might be a change in code with Revit 2019?

Have you tried in 2018? Until they update the API page for 2019, I can’t check anything.

I will check soon. I couldnt see any changes in the API that I’m aware of, i dont really know what im looking at though. The SDK kit is out for 2019 now.

image

We aren’t using 2019 here yet and I don’t have admin rights to install programs without approval so I can’t easily access the 2019 docs.

Have you made sure that the curves you are using form a closed loop and fully continuous? It may also be that the shape is not an exact rectangle as some views do not allow non-rectangular crops.

You could try adding a try/except inside the custom node so you can output any errors/exceptions from the API. It will at least tell you where it failed instead of just a null.

See the bottom of this page for the exceptions: SetCropShape Method and make sure none of them apply to your curves.

1 Like

The node seems to work fine for me in Revit 2019. Have you tried supplying a flattened list of views and a single list of curves, like this:

2 Likes

hi @T_Pover is it still not possible in 3d view?

Someone else set up this project. It was scope boxes… Thanks for everyone’s help! Maybe something you could add to the python to turn it off if you can be bothered @T_Pover