Hi, I’m little bit lost in my attempt to create Python script to get station of alignment where instantaneous radius is smaller than input.
# Load the Python Standard and DesignScript Libraries
import sys
import clr
# Add Assemblies for AutoCAD and Civil3D
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
clr.AddReference('AutoCADNodes')
clr.AddReference('Civil3DNodes')
clr.AddReference('Autodesk.Civil3DToolkit') # import the assembly
import Autodesk.AutoCAD.DynamoNodes as DA # assign alias for AutoCAD nodes
import Autodesk.Civil.DynamoNodes as DC # assign alias for Civil 3D nodes
algn = IN[0]
station = IN[1]
def inR(al, st):
r = DC.AlignmentExtensions.GetInstantaneousRadiusAtStation(al, st)["Radius"]
return r
n = 1
R = 150
s = 900
num = 10
while num > 1:
r = inR(algn,s)
num = r-R
....s += 1
....if s == 100:
break
OUT = s