or with curve length from a excel or text file with radius values. this are following files i try with macro, lisp, and dynamo but getting error. Any assistance provided would be greatly appreciated.Thank you in advance for your help!
add curves to profile.dwg (951.8 KB)
Add parabolic curve to profile.dyn (61.4 KB)
@Aparajit_Pratap is it possible to fillet one vertex of a polycurve? If not this might be a good addition in a future release.
This Python might help for a standard arc, though my methodology doesn’t align to your excel file.
Edit: Missed a namespace on the copy/paste
# Load the Python Standard and DesignScript Libraries
import sys, clr #add the sys and clr modules to the Python environment
clr.AddReference('ProtoGeometry') #add the Dynamo geometry library to the CLR
import Autodesk.DesignScript.Geometry as DG #import the Dynamo geometry library as DG to prevent namespace collision
polyCurve = IN[0] #the polycurve from the Dynamo environment
radii = IN[1] #the list of radii from the Dynamo environment
crvs = polyCurve.Curves() #get the curves from the polycurves
if len(radii)+1 == len(crvs): #if the radii count aligns perform the following
i = 0 #set the initial iterable value to 0
netCurves = [crvs[0]] #set the initial list of resulting curves to the first curve
for radius in radii: #for each of the radii
c1 = netCurves[-1] #get the curve from the list
c2 = crvs[i+1] #get the next curve
arc = DG.Arc.ByFillet(c1,c2,radius) #generate the arc
trimPoint = arc.StartPoint #get the start point of the arc
c1 = c1.SplitByPoints([trimPoint])[0] #trim the first curve by the trim point
netCurves[-1] = c1 #set the last curve in the list of net curves to the trimed curves
netCurves.append(arc) #append the arc to the list of curves
trimPoint = arc.EndPoint #get the end point of the arc
c2 = c2.SplitByPoints([trimPoint])[1] #trim the next curve by the trim point
netCurves.append(c2) #append the next curve to the list of curves
i += 1 #increment i by one
else: #otherwise throw an exception
sys.exit("\r\r\tRadii count not equal to number of verticies in polycurve. Adjust the inputs accordingly.\r\r")
OUT = netCurves #return the filleted polycuve
@jacob.small, not that I know of. Will make a note of it as a wishlist item.
1 Like
@Aparajit_Pratap @jacob.small brothers thanks for your reply, it is easy and effective if it possible though excel or txt file,
I have one more method to make profile from asci(text) file which is working, but for that station elevation and parabolic curve length is need
cons
it doesn’t give output with circular curves and also not works with radius of parabolic and circular curve,
@ mzjensen
if anyone gives length to radius conversion formulas for parabolic and circular curve exactly which civil 3d used in profile design would be greatly appreciated.
It should be doable - you’ll have to implement and perhaps make a few updates to the Python above to make it so.
@jacob.small brother thanks for your reply, I’m not proficient in Python, and despite trying the code you provided, it didn’t work.
How did you try it? It is working for me…
@jacob.small Will you please share those DYN files and a clip of the output you are getting? It would be very helpful for me.
Won’t be at the PC until Monday night as I’m doing some family stuff this weekend, but will post when I can. In the meantime if you post what you have tried I can help give you some guidance.
@jacob.small Okay, brother. Share the files when you have time. I just started learning Dynamo and python, and what I have tried has not given appropriate results. I will wait for the file; it is not urgent.
The inputs for the node are fairly straightforward. A polygon and a list of radii in the order that the PolyCurve wants to apply the fillet. Are you trying to feed in many polycurves per chance?
Certainly working on my end:
@jacob.small I apologize for my delayed response brother. I was unable to reply earlier due to illness. I tried using your screenshot, but I encountered errors. Could you please share your .dyn file? Also, could you confirm whether it provides accurate results for both circular and parabolic curves, using both length and radius? This is exactly what I need.
I am not a civil engineer so how you define a parabolic curve isn’t clear to me; that said yes you could modify the code to do such, but I don’t have the bandwidth to do so.
What my DYN had is exactly what you showed, so sharing that won’t help. You need to address the environmental variation on your end.
To help you do so I need to know what the warning in the first code block is. Likely a namespace conflict as Civil3D hasn’t done a very good at keeping the Dynamo for Civil namespaces from conflicting with the Dynamo namespaces (i.e. they both have a ‘Line’ class). If that is the case you’ll need to add the namespace (i.e. Autodesk, or DesignScript, or Autodesk.Geometry) before the failing class name.
@jacob.small Thanks a lot brother for your effort.