In ArcObjects .NET SDK, we can write the following sample code to change the representation shape of a line feature without changing its real shape:
IRepresentation rep = repClass.GetRepresentation(feature, mapcontext);
rep.Shape = line;
rep.UpdateFeature();
rep.Feature.Store();
However, With ArcGIS Pro SDK for .NET representations, I cannot find a way to complete the same function (Draw layers with representations—ArcGIS Pro | Documentation). Insteadly, I can only change the real shape of a feature now.
The reason I want to do this is to hide some segments in a Polyline and create a line with multiple parts, including the hidden parts in the original position, that is, to create a polyline composed of segments with different intervals. In this way, the previously hidden parts will also be spaced in the new polyline (although this polyline may appear to have some "interrupted" parts with no actual line segments connecting between them).