In theory that should work. Give it a try!
Wow, so as expected, its a bit more complicated than I might have thought.
Aside from a few relatively minor reworkings (related to capturing the alignments, and setting stationing, etc.), the two big differences are:
- removing the entire portion for the surface daylight targets (temporarily, while I get a better understanding of everything else)
- changing the corridor surface from building by Links to Feature Lines
So far, it is successfully naming and creating the Corridors, and creating the Corridor Surfaces; however, it is not naming the Corridor Surfaces correctly (it takes the first name on the list and applies that name to the second CorSurface as well), and the CorSurfaces arenât having any corridor Feature Lines added to them (so theyâre just empty surfaces).
Again, note that I excised the entire Targets portion, and reconnected the nodes as seemed logical. And the Python script was editing to attempt to use Feature Lines instead of Links to populate the surfaces.
Iâm obviously getting in a little over my head. Simply swapping âsurf.AddLinkCode(link, True)â with âsurf.AddFeatureLineCode(featureLineName)â doesnât appear to be a 1:1 switch, and I must be missing something else that is needed to make it work. At least, I think thatâs the case. Maybe it is something in the dynamo workflow? But I believe I reconnected the nodes correctly after removing the Targets portion. Iâm still working out exactly how the âpassThroughâ Code Blocks are affecting the routine.
The dynamo file is attached, and a screen of the edited Python script.
CreateCorridorsAndCorridorSurfaces.dyn (70.7 KB)
Any hints would be greatly appreciated, but I understand I still have a ways to go in really understanding just what Iâm doing (lol).
Edit: this routine should work with any drawing that has at least 2 alignments and a profile with each alignment.
Edit2: Also, an assembly named âMAINâ with a âLaneSuperelevationAORâ subassembly included will be needed (for the âCrownâ and âETWâ codes).
I havenât looked at your DYN file, but I can see why the Python node wonât work as written. Youâve replaced âlinkâ with âfeatureLineNameâ, but you havenât changed anything else about the function. There is no input to the function called âfeatureLineNameâ and therefore no codes to try to add to the surface.
Oh I see now, âsurf.AddLinkCode(link, True)â is looking for the âlinkâ variable
But âsurf.AddFeatureLineCode(featureLineName)â has no âfeatureLineNameâ variable
I was confused about where the actual âlinkâ variable was even declared in the Python script. I see âlinksâ declared up at the top, and used subsequently; I suppose the âfor link in linksâ must be where this is introduced.
Anyway, I changed âsurf.AddFeatureLineCode(featureLineName)â to âsurf.AddFeatureLineCode(link)â, and it both added the correct codes to the surfaces, and fixed the naming of the surfaces.
(I know as a best-practice I should have changed the variable name in the Python Script from âlinksâ to âfeatlinesâ or something like that, but I just wanted to minimize the chances of introducing more errorsâŚ)
Now, it appears to work as hoped! A couple very minor mysteries, probably having to do with the dynamo workflow: the corridors are left alerting to be rebuilt and the cor-surfaces are not âtakingâ the shrinkwrap boundary. But I really donât care, because a manual rebuild-all does the trick for both issues.
Here are the latest:
CreateCorridorsAndCorridorSurfaces.dyn (70.6 KB)