I am working on a simple program to create alignments from polylines, and am wondering if there are any nodes available to set the start station of an alignment. The current Civil3DToolkit node “CreateAlignmentByPolyline” does not allow for setting the alignment start station. Rather than start at station 0+00 I would prefer something like 10+00. Thanks.
@hestingjj the API doesn’t allow setting the start station when creating the Alignment, but you can set it afterwards with the ReferencePointStation property.
import clr
clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
def set_alignment_start_station(alignment, station):
adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
aeccAlignment = alignment.InternalDBObject
aeccAlignment.ReferencePointStation = station
t.Commit()
pass
return alignment
OUT = set_alignment_start_station(IN[0], IN[1])
Very cool, I got it to work for one alignment, just had to make sure it was a “number” type for stationing. Can I feed it alignment list and station list? I tried but not getting it to work. Thanks for sharing!