I’m a beginner in Python and Civil 3D API.
I managed to create a code that adds widening to an offset alignment with given
parameters. That works as intended. I want to add an option to change TransitionType, but I get the following errors depending on using brackets or parentheses:
This is the code:
adoc = Application.DocumentManager.MdiActiveDocument editor = adoc.Editor def addwidening(alignment): global adoc with adoc.LockDocument(): with adoc.Database as db: with db.TransactionManager.StartTransaction() as t: id = alignment.InternalObjectId; alignid = t.GetObject(id, OpenMode.ForWrite, True); oInfo = alignid.OffsetAlignmentInfo; oInfo.AddWidening(100, 400, 10); r = oInfo.Regions; rent = r.EntryTransition; rent.TransitionType; entrydesc = r.EntryTransition.TransitionDescription; entrydesc.Length = 50; rext = r.ExitTransition; #rext.TransitionType(2); exitdesc = r.ExitTransition.TransitionDescription; exitdesc.Length = 50; t.Commit(); return rent # Assign your output to the OUT variable. OUT = addwidening(IN)
What is the proper way to set that value?
Thanks in advance.