Select to view content in your preferred language

Line length restraints that always draw at a specified length

397
3
08-29-2025 06:12 AM
tbearb
by
Frequent Contributor

Does anyone know if it is possible to restrict a line to only draw at a specific length upon each creation? For example, we are looking to have a user draw in "U-branch" lines between our water meters that will always be 1ft long, not any shorter, not any longer.

If that is not possible, does anyone know if custom symbology can be made that always draws a "V" shape that we can connect between our water meters. This could also serve as our "U-branch" feature.

Attached image for illustrative purposes. Thanks!

0 Kudos
3 Replies
MErikReedAugusta
MVP Regular Contributor

Spit-balling: If they're always 1 foot, maybe you could have a script that's watching meters get created and checking within a 1-foot radius every time one is created.  If it finds one, the script creates the line.

That certainly sounds like an Attribute Rule, but I genuinely don't know if the necessary functions exist, and I suspect it'd be very computationally expensive.  The other alternative is a python script tool that runs on-demand and does the same thing.

 

As far as the "V" shape portion of your question, I think it'd have to be either/or, and that actually strikes me as harder to do than the simple line.

 

...Unless...

If it's purely a symbology issue, you might be able to fake something with the symbols on your meters, but it's gonna be really tricky to get the sizing of elements correct.  And if you need something you can snap to/edit/etc., then symbology won't help you.

------------------------------
M Reed
"The pessimist may be right oftener than the optimist, but the optimist has more fun, and neither can stop the march of events anyhow." — Lazarus Long, in Time Enough for Love, by Robert A. Heinlein
0 Kudos
DavidPike
MVP Notable Contributor

Might be stating the obvious but pressing 'd' to restrict length when digitizing.  Could probably have it set as a 'task' Introduction to tasks—ArcGIS Pro | Documentation

0 Kudos
sjones_esriau
Esri Contributor

For a quick solution, the 'd' shortcut will be your best bet as David suggested above. Your operators will have to set the distance however as it default's to the current segment length.

If this is something you do 8 hours a day then there are a few solutions:

  • Create the feature(s) once then generate a preset template from selected features
  • creating an attribute rule on the layer (per M Reed) to recalc the geometry to a fixed length
  • making a task to create the feature then run similar code
  • create a construction/segment tool with the Pro SDK and assign it to the create feature template

All have pros/cons. Good candidate for an ArcGIS Idea.

 

Arcade code for prosperity...

// Desired fixed length in meters
var targetLen = 100;

// Get the geometry of the feature
var geom = Geometry($feature);

// If the geometry is empty or has fewer than 2 points, return as is
if (Count(geom.paths[0]) < 2) {
    return geom;
}

// Get start point
var startPt = geom.paths[0][0];

// Get the azimuth (bearing) from start to end
var endPt = geom.paths[0][Count(geom.paths[0]) - 1];
var az = Angle(startPt, endPt);

//convert to radians
var angleRad = az * 0.01745

// Create a new endpoint at the fixed distance
var newEnd = Point({
    x: startPt.x + targetLen * Cos(angleRad),
    y: startPt.y + targetLen * Sin(angleRad),
    spatialreference: geom.spatialReference
});

// Return the new geometry
return Polyline({paths: [[startPt, newEnd]], spatialReference: geom.spatialReference});