Hi @Anonymous ,
I interpret your question in the following way: you want the section to vary depending on whether "THE SOIL" in the analyzed progressive corresponds to Rock or Loose Material (Areas that you will already have identified).
If so, I recommend using an offset Target that represents the rocky material and that when this is active, the corresponding cut slope is used.
Use the next expression in the Slope value of the Point with SlopeToSurface type:
If(RockedArea.IsValid,RockSlope,SoilSlope)
1 Create the SLope input parameters

2 Create the SurfaceTarget and OffsetTarget

3 Insert the points, and assign the expression to the Slope property in P2

4 When the OffsetTarget (RockedArea) is valid, the grade will be the one assigned for the rocky zone (500%).

5 When the OffsetTarget (RockedArea) is NOT valid, the grade will be the one assigned for the non-rocky zone (30%).

I attach the pkt that I think would be the right one.
It is necessary to say that in civil 3d, the polyline that will be used as a target will simply serve to validate the existence of the type of rocky soil, and will not affect the geometry of the corridor (it will not be projected or stretched to the same polyline); therefore, the distance at which it is drawn does not matter.
Regards.