Hi,
Is it possible to create a vertical line at the center of each circle?
As you can see, Line.ByStartPointEndPoint
takes two points as the input. You have one point from the center of the circle and then you need to determine how you want to create the second point. Depending on what plane you’re working in, “vertical” could just be a change in the Y coordinate or the Z coordinate. You can make that change by deconstructing the first point and modifying the new coordinate or by using a vector and distance.
Hi @Nick_Boyts is it still possible if the arrangement is like in the screenshot below. The red lines is where I want the lines to be created.
I don’t know what I’m looking at, but sure. If you have locations (circles) and know the direction of the line then all you need is Line.ByStartPointDirectionLength
. It seems you have all the pieces you need, but we don’t have a good idea of what your logic is.
Hi @Nick_Boyts I want to create a vertical line at the center of each circle. I want the line to be the same length as the green vertical line (dimensions in green). Is this possible to do with the dynamo node? Hope this helps.
- Group the circles by which surface they intersect.
- Get the horizontal edges from the surface.
- Get the point on the first horizontal edge closest to each circle.
- Get the point on the second horizontal edge closes to each circle.
- Draw a line from the point on line one to the point on line two.
Hi, here’s another example with a single frame (note: this must be parallel to the X axis).
The Python script is designed to avoid having multiple lines overlapping at common points in the X axis.
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
pts=IN[0]
stock=[]
stock2=[]
for p in pts:
stock.append(round(p.X,6))
res = list(dict.fromkeys(stock))
for index, value in zip(pts, res):
stock2.append(index)
OUT = stock2
Sincerely,
christian.stan
Hi @jacob.small, All the elements are drawn using model lines, I’m not sure if I’m using the correct node to get the surface. I’m trying to create a list of circles that are closest to the horizontal edges but its not working.
Create line from center of circle.dyn (37.4 KB)
Which version of Revit is this in? Can you post a model if it’s a supported build? Otherwise people like Nick, Christian, Myself and anyone who wants to try to help you more directly need to first spend 15 minutes looking at your pictures and rebuilding a Revit model based on the assumptions we make looking at your screenshots.
In this case I never would have expected all of that to be model lines so I wouldn’t have been able to get anywhere near what you need.
One last note… I am guessing that you likely have extenuating circumstances that produced this situation, and hopefully it’s a one time thing. However the time you are currently spending to build this automation has a lower ROI than if you spent it overhauling the workflow that got you to this point so that you have more of a BIM process. This many model lines is an indication of teams “doing CAD but in Revit” which is both in efficient from a technical standpoint (the tools in AutoCAD are better for CAD purposes) and from a cost standpoint (AutoCAD costs less than Revit).
Hi @jacob.small Revit model attached. Revit version is 2022.
Create line at center of circle_detached.rvt (2.5 MB)
Sadly I don’t have 2022 installed anymore as it is unsupported (and therefore a risk to keep using in production), but I can try to have a look in 2023 when I get a chance. You may have to make changes to get it working in 2022 though.
Hi @jacob.small, Revit model upgraded to 2023.
Create line at center of circle2023_detached.rvt (2.5 MB)
hi
Python script
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
pts=IN[0]
def necessarypoint(pt):
stock=[]
stock2=[]
for p in pt:
stock.append(round(p.X,6))
res = list(dict.fromkeys(stock))
for index, value in zip(pt, res):
stock2.append(index)
return stock2
stock2=[]
OUT = [necessarypoint(pt) for pt in pts]
script:
rep 30 mai.dyn (137.4 KB)
cordially
christian.stan
Hi @christian.stan, Thank you for this. Can you recommend a good starting point for learning the basics of Python, within the Dynamo workflow?
hi thanks
cordially
christian.stan