Create List in Code Block

Hi All

I’m working on a terrain model and I have a series of points I need to group into a single list.
Is there a shorthand way of combining them without typing every single point as I have done in my codeblock (see image).
Sorry if this has been answered before. I’m struggling to find a solution. Thanks.
See dyn file attached.



Toposurface Modelling 2.dyn (22.0 KB)
2021_07_20_Solid Topography.sat (1.5 MB)

I suppose the first question is: “Where are you getting your external point data from?”

Dynamo can import txt, csv, xlsx data which you can then clean up. For instance, if the XYZ data is stored in individual cells in an Excel table, you can import the table and use the cell data to create the points list.

If the data structure is consistent between projects your code block goes from being manual entry to standardized list cleanup (delete some headers, transpose some data, etc…)

Hi there thanks for the reply. The point data is coming from a drawing I’ve made in Revit. It has to be done this way because of the custom landscaping we are trying to achieve. I don’t think I asked my question properly.
I just want to know if there is a faster way of grouping points EP1 to EP22 without having to type each one like [EP1,EP2,EP3,EP4,EP5]
Thanks.

image

Something like this?

Thank you. Not what I’m looking for though. Is there a way of having them with the key in front. Each point is tied to a code on a drawing so it would be cool to have them with the EP1,EP2…
Just for clarity and future adjustments.

Sounds like a dictionary might do the trick for that.

You don’t need to repeat Point.ByCoordinates, but you you’ll need to provide the values

See if you can modify the code below to take in variables as and when required. You might need to split by individual coordinate values
eg. EP1.X, EP1.Y, EP1.Z …

points-ds

Point.ByCoordinates([1,4,1,1,1,1],[2,5,2,2,2,2],[3,6,3,3,3,3]);

5 Likes

Consider using a Dynamo script to place the points as an adaptive point in Revit with a mark, then in a second script you can retrieve these by their mark, as well as get their location.

I find sometimes doing 100% of a workflow in Dynamo isn’t the way to go, and will usually lead to a workflow that is redundant beyond a single project.

1 Like

Hi Vikram. Thanks so much. That would have been a much better way to do it.
Much appreciated. I should have thought of that. Haha.
Still learning.

1 Like

Agreed. This is indeed only applicable to the project I’m working on. I’ve used a plugin called site designer in the past to modify Revit terrains but I don’t find it as intuitive as using dynamo. Also not as accurate in manipulating points I find. Thanks for the suggestion.

1 Like