Hi all,
I have got an exception "The SubassemblyTargetInfoCollection is not got from the BaselineRegion." while trying to set targets for a baseline region of a corridor. I searched online and found the following posts, however none of them is able to help.
Post I have found online:
My goal: to set a subassembly(LaneSuperelevationAOR)'s offset target to an alignment and elevation target to the alignment's profile
My code: THE EXCEPTION HAPPENS AT THE LAST LINE OF THE FOLLOWING CODE. THANK YOU IN ADVANCE FOR ANY HELP.
// set subassembly targets SubassemblyTargetInfoCollection targets = centralCorridor.Baselines[0].BaselineRegions[0].GetTargets(); foreach (SubassemblyTargetInfo target in targets) { if(target.TargetType == SubassemblyLogicalNameType.Elevation) { ObjectIdCollection ids = target.TargetIds; ids.Add(ProfileId); target.TargetIds = ids; } else if(target.TargetType == SubassemblyLogicalNameType.Offset) { ObjectIdCollection ids = target.TargetIds; ids.Add(AlignmentId); target.TargetIds = ids; } else if(target.TargetType == SubassemblyLogicalNameType.Surface) { } } centralCorridor.Baselines[0].BaselineRegions[0].SetTargets(targets);