Hello, so I created my first script in dynamo that assigns coordinates at two instance parameters of a general annotation family to export a schedule with them. That was my very first time using Dynamo. What I am trying to achieve is having a schedule with the coordinates of specific points and the distance between the points to close the loop. I tried assigning an ascending label at the points through dynamo as well but didn’t make it so I ended up adding another instance parameter that I would fill manually. The question is can I calculate distances between points at an ascending manner (1-2,2-3,3-4,4-5,5-1), what I understood is that I should start from creating the line to connect them to begin with. Sorry for not uploading the script but I was allowed to upload just one picture since I am new user.
Hello @markpen - welcome to the community!
You can do something like follows;
- I’ve made up some mock-points like you have shown in your image, but you can replace those as a collection from Revit if you want
- I am using a custom node from the
Springspackage called /W Points.ConvexHull2D which allows you to correctly collect and order points in 2D in order to create a polycurve between them. It’s super cool, because if you have other points inside those loops, it will remove them. You may not need this step, but I thought it useful to include.
- I am then creating a PolyCurve.ByPoints and putting in a True boolean into the optional input to close that curve. This gives us our full loop!
- After we have created that PolyCurve, we want to break it down into the component pieces - and use the PolyCurve.Curves node to do this. This gives us 5 curves.
- And lastly, we simply want to get the length of each of those curves, so we use Curve.Length
To begin with thank you very much for the time spent. I will be honest with you AmolShah as mentioned it’s the first thing I did so I don’t understand the Code Block. So I followed solamour’s approach that felt easier to understand. Though as you will see, I need to create points from the 2 instance parameters of the the family Easting and Northing. These two parameters have gotten their value from the first script I did which assigns them the survey coordinates accordingly. So is there a way to create points from what I have? Thanks once again
This time I understood AmolShah and got the hybrid answer I was looking for. You were both really helpfull and fast on answering. Thanks
@markpen We’re glad that you found what you were looking for.