How to set individual feature shape with symbol system?

283
2
01-31-2024 06:13 AM
HaoWong
New Contributor III

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).

0 Kudos
2 Replies
CraigWilliams
Esri Contributor

In ArcGIS Pro we made the decision to bring display capabilities of Representations into the core symbology model. The two main exceptions being shape overrides and marker overrides. We're collecting feedback on the need to shape overrides in this ArcGIS Pro Idea, so please add you feedback to this item if possible.

That said, I believe your case can be achieved without a shape override. Using control points and a suppress effect you can suppress segments between the control points. Control points do require a small geometry update (see this topic for how to achieve this in the Pro UI). At the API level this involves marking the ID (MapPoint.ID) of a vertex to 1.

HaoWong
New Contributor III

From your second web link, I found the 'Suppress' is indeed the thing I want! But in the API level, do you mean when the ID of mapoint is set to 1, it turns to a control point? If So, what should we do with the control points next with programming to Suppress line sections?

By the way, when you try to change a exsiting MapPoint.ID, the Visual Studio reports 'Compiler error CS0200', and I think it is because the ID property of Mappoint is readonly. As a result, it can not Convert Vertex to Control Point.(Edit control points—ArcGIS Pro | Documentation)

0 Kudos