Get grid locations of several linked models

Hi All, I have dozens of linked files that I’m trying (and failing) to create a Dynamo script for, to locate all their grid lines so I can do an audit of their alignments against each other. I need to then get this info in excel with the linked file name, their particular grid names and their location (x, y coordinates) so I can create a dashboard showing which grids are correct and which ones are misaligned. I’ve tried countless times and am getting absolutely nowhere so I don’t have any examples that would be worth anything.

Any help on this would be GREATLY APPRECIATED!!

Yes, its certainly do-able. Show us what you’ve done & someone will help you

Process would be something like:

  • get linked docs
  • get elements of a category from the linked docs (grids)
  • get the geometry of the elements (curves)
  • get the start & end points of the curves
  • export the coordinates

Incidentally- it might be too late in this case, but the Revit copy monitor tool is designed for exactly this

1 Like

Hi Andrew,

Thank you for the reply. I have tried 3 different methods with partial success, but nothing close to what the goal is. Here is what I have thus far. I’m not able to get the actual grid line names in the 2nd example, and I’m also not able to tie the links and their respective grid lines together. All the help is much appreciated!

Here is the 1st attempt:

And the 2nd:

At first glance i think you should look into Levels (and Lacing). Not behind a PC anymore so i can’t give you and example.

How many Linked Models do you have and how many Grids should you get (have)?

You need to combine your List with the Linked Model names with your List of Grids.

The first item of each List should be the name of your Linked Model follow by the Grids.

Hi bvs1982,

I will eventually have over 50 linked models containing hundreds of grids. This is why an automated method will save hours of time.
I’m not sure what you mean by Levels (and Lacing).
Thank you for the help.

So i guess you should have gotten more than 11 Grids in your first image?

But 50! Linked Models?!?

Yep, and 50 models is on the low side of normal lol!!
I’m just trying to get the script to work with 2 linked models for now, as the whole project would take waaay too long to load for testing.

You might need to fiddle with your Levels and Lacing in this :backhand_index_pointing_down: node.

@michael79

You seem to be on the right track in attempt 1, but the issue is getting your lists into the right structure- as @bvs1982 says, levels and lacing are important here.

If you look at the outputs of the link names and the coordinates that go into string.join, you will see the data is arranged differently.

I’d suggest:

  • removing the part to write Excel for now
  • getting the list data into the correct structure first- use a watch node or the output preview
  • post the .dyn so others don’t have to recreate it

@bvs1982 & @Andrew_Hannell ,

Thank you so much for taking the time to help me with this. I’ve been extremely busy over the last couple of days, but I will implement your suggestions above today. Definitely looking like this is achievable!

@bvs1982 Ok so I started with replicating what you had, just as a starting point, and I ran into some errors as shown below. I tried messing with levels to no avail. What is the 0.5 in the Code Block representing? Getting closer thank you!

The mid point of the curves.

You can also get the start- and endpoints instead and write those to Excel. I thought it would be easiest to just compare single points.

What does the error say?

Maybe curve for the Curve.PointAtParameter node should also be set on @2.

I just threw that example together real quick. Also not behind a PC anymore to test / check.

@bvs1982 0.5 works perfectly, thank you for the explanation.

Left most error: Internal error, please report: Dereferencing a non-pointer.

Middle error: List.AddItemToFront operation failed. Value cannot be null. Parameter name:C.

Right most error:List.Transpose operation failed. Object reference not set to an instance of an object

Well, if the one node gives a warning that will carry upsteam. So i guess if the warning of the first nodes (which gives a warning) gets fixed the rest gets fixed.

I was able to clear the errors by messing with the levels, but now I just get a list of the linked models followed by a whole list of the grid lines. (List.Transpose)
Also, the gridlines are only coming through as numbers, even though half of them are lettered grids.

I don’t think you had to change the Levels for the …LinkInstanceElements node.

Are you sure every Linked Model has Grids?

But i can’t test / check today anymore.

?

No luck changing any of the Levels on the nodes.

Most links have grids, but not all.

Grid names: Some are numbered: 1, 2, 3, etc. & some are alphanumeric: A, B, C, etc

Again, thanks for your help!

Thats probably the reason why you got the warnings.

Filter out the Links which don’t have Grids. Maybe it can be as simple as using List.Clean (@2) after the …LinkInstanceElement node.

I got that, but no where in your a getting the Grid names. So far only the center of the Curves.

You have to get Grid names using other nodes.