Get station of alignment where instantaneous radius smaller than input

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

image

Are those literal dot characters? You enabled some whitespace display, but in two lines you wrote literal dots. You can see in your copied code, in two lines it remained dots. It’s also visible on your screenshot: dots in those 2 lines are on the bottom of the line, while in any other lines they are in the middle.

The while loop should look like this, note there are no dots:

while num > 1:
    r = inR(algn,s)
    num = r-R
    s += 1
    if s == 100:
        break

@infeeeee
Thank you. I don’t know how this happend.