Corridor Transition Package?

I was wondering if there’s any package that has added anything corridor transition related to it? I imagine it’s not an easy task and it’s relatively new to C3D so I wasn’t sure if there just hasn’t been enough time to develop it and I’m assuming this isn’t a job for those who thankfully create packages for us.

Corridor transitions are easier to manage in C3D24 but it can surely become a much more streamlined process with the help of Dynamo.

FYI for anyone who is interested in corridor transitions and utilizing them, an AU class was done and includes exactly what I’m talking about regarding implementing them. Not sure if Elliot Grubb is on here but gotta give a shout out to him!

There are also a ton of other great classes that have been posted regarding Dynamo use with C3D.

3 Likes

I have another update for this! After developing a script that will create multiple transitions at once, I ran into an issue where it would wipe out the previous transitions. I reached out to Elliot Grubb and he was able to fix this issue. Here is the updated python node. This should no longer wipeout existing transitions and allow for continuing to create them after changing variables in the Dynamo Player dialog.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import traceback

# 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 *


adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor

corridorin = IN[0]
transetname = IN[1]
saname = IN[2]
paramname = IN[3]
startstation = IN[4]
endstation = IN[5]
startvalue = IN[6]
endvalue = IN[7]

def SetTransitionVaues(tran,startstation,endstation,startvalue,endvalue):
    with adoc.LockDocument():
        with adoc.Database as db:    
            with db.TransactionManager.StartTransaction() as t:
                try:
                    tran.StartStation = startstation
                    tran.EndStation = endstation
                    tran.StartValue = startvalue
                    tran.EndValue = endvalue
                    tran.TransitionType = CorridorTransitionType.Linear
                        
                    return tran   
                except:
                    return traceback.format_exc()                     
                    

################################################################################
with adoc.LockDocument():
    with adoc.Database as db:    
        with db.TransactionManager.StartTransaction() as t:
            try:
                
                    
                
                    #Get corridor and baseline regions for first baseline
                    corr = t.GetObject(corridorin.InternalObjectId, OpenMode.ForWrite)         
                    baselines = corr.Baselines[0]               
                    #Count number of baseline regions
                    blregion = baselines.BaselineRegions[0] 
                    
                    #Get existing transitions
                    transets = baselines.getTransitions()              
                
                    #Create the transet
                    transet = CorridorTransitionSet(transetname, blregion, saname, CorridorTransitionNameType.SubassemblyName)

                    i=0
                    noOfTrans = len(endstation)      
                    while i < noOfTrans:
                        
                        tran = transet.AddTransition(paramname)
                        SetTransitionVaues(tran,startstation[i],endstation[i],startvalue[i],endvalue[i])
                        i += 1                        
                    transets.Add(transet)
                        
                    baselines.SetTransitions(transets)
                    
                    t.Commit()
                    output = transet.Name
            except:
                    output = traceback.format_exc()
OUT = output
1 Like