Revit Dependent nodes need to be cached

Hi,

I created a script, in which I am using BimorphNodes - Curve.IntersectAll node. I wanted to create a Generative Design study, but I got the message:

“These nodes (it’s referring to Curve.IntersectAll) are Revit dependent and therefore need to be cached. Nodes that need to be cached cannot be placed in an evaluation loop (after an input node and before an output node).”

I was wondering how I could fix this problem.

Do you have any idea?

Many thanks in advance for your suggestions!

Best regards,

Julia

I’d recommend going through the Generative Design Primer. It will walk you through all the basics for creating GD graphs, like caching data, which requires a Data.Remember node.

Hi Nick,
thank you for your fast reply.
I think I understood the problem. I try to explain it:
I use the Revit geometry and when I import it to Dynamo I use the Data.Remember, so all data are stored there. The first part of the script is varying some input data to transform the geometry. This geometry is the input for the Curve.IntersectAll node. After this node i will have other inputs that will make further changes in the geomatry.
So in the GD study I would need that this Curve.Intersect node calculate me data which will be used as further inputs of the second part of the GD study.
As far as I understood, in the GD study there cannot be any Revit dependent node, so I would need to replace the current node with new one which would create me intersection points of lines in a surface perimeter (basicly clash detection). Do you know how I could obtain it?

I hope you got the point.

BR,

Julia

Correct.

Not necessarily.

None of the nodes can be directly dependent on Revit data. In most cases, this means caching your Revit data as soon as possible. The Curve.IntersectAll node isn’t dependent on Revit data. The Curve.ExtendEnd node isn’t dependent on Revit data either. You can keep working backwards until you hit any of your native Revit data and then try a Data.Remember node. Geometry is fine, whether it comes from Revit or not. The element that defines the geometry is what needs to be cached.

If you post an image of your full graph we might be able to better determine where you should cache your nodes.

1 Like

It may also be that the package loads a Revit DLL into the package, and since Curve.IntersectAll is in the same area it’s dependent on the existence of that Revit DLL, even though it need not be utilized.

2 Likes

Hi Nick,

I think all elements that define the geometry are cached. However, I attach my full graph. Maybe I missed something…
Many thanks!

Dear Jacob,

perhaps it is the case. Do you have any idea how I could bypass this problem? Is there any other node that does the same job as Curve.InteresectAll?

Many thanks!

Julia

Not sure what the other node does, so I can’t say. Perhaps Geometry.Intersect?

The logic in using the Curve.IntersectAll is the following:

  • I have a list of lines, which create a perimeter of a polygon.
  • I intersect all lines to find the intersection points - vertices of the polygon.

Please see below:
Picture123

Good catch Jacob. I think you’re right.

If your lines are already in the right order and direction you can just convert them to a polycurve.


Otherwise you will likely have to intersect everything and potentially reorder points, which can be a pain, but I’m guessing since the bimorph node has everything in order that it won’t be an issue for you.

1 Like

Thank you! I will test it:)

Might be faster to start with a surface, and split that rather than going to curves. Hard to say though with the sample we’re seeing.

If you get stuck after looking over nick’s post let me know and I’ll try to have a look during a break at some point this week.

1 Like

Hi Nick,

I analysed it and I think it will be hard to manage considering my needs.
I have 40 curves I need to offset them in the further step of the script. I would need to have 3 sliders for offset (a,b,c). I need to pick up only these points which are vertices of my shape. It will be easier to manage because I will have only 8 lines instead of 40.
With Curve.IntersectAll, I got these 8 points and now I am struggling with how to define these points:)

It’s a pretty good amount of work to get just the vertices of the simplified surface. You’d likely have to step through each point and look to see if the next point in the list is along the same vector or not to see when the edge direction changes. You could also try grouping all the curves by vector and relative location. None of it is particularly hard, but might take some time to work out step by step.

1 Like

Look at the geometry you’re showing, I feel like instead of offsetting the curves you should be utilizing some vector math to just move the points… Will the curves always be linear?

2 Likes

I went ahead to see if I could come up with a “quick and easy” solution and I think I actually found one. If you group all the curves by vector (after rounding and normalizing for accuracy) you can then compare all the start and end points within a grouping. Removing the duplicates leaves you with only the points that don’t overlap within the same vector grouping - ie. only points that change in direction.

2 Likes

Dear Nick,

thank you very much for this solution! Now, I will try it:)

Best regards,

Julia

HI Nick,

may I ask you to see the part before List.GroupByKey node?

Thanks!

Julia

Dear Nick

sorry for bothering you again with this topic. I finally found the same approach that you showed in your example. It works, but there is one issue. The order of the points is mixed up.
Do you have any idea how I could reorder them automatically? Do you have in mind any rules?

Many thanks!

Best regards,

Julia
Picture126

Sorry for the late reply. I was out at AU all last week and not really checking email much.

Unfortunately, this is just the trouble you have when dealing with mixed or unordered objects (especially geometry). A lot of the logic being recommended is reliant on the geometry already being ordered. Otherwise it can be a pretty involved process to get them reordered.

There’s no trick to it. It just requires you to think through the best way to find or determine logical order. I’d recommend trying to reorder the geometry when you have a fully connected “system” at the beginning, before reducing the number of points. This should help since everything will still be connected at that point.

1 Like