Select to view content in your preferred language

IBufferConstruction in PRO Sdk

488
3
05-07-2018 01:20 PM
MKa
by
Frequent Contributor

I am wondering if there is an equivalent to IBufferConstruction in the PRO SDK.  It is necessary that for a given line for one of my tools, that the user be allowed to buffer left/right/full and to have round/flat endpoints.  I am essentially getting drawing line from user and then prompting them with how they want it buffered?

Does this exist in PRO like in ArcObjects Below? 

//Setup the Buffer Constructor and its Properties
            IBufferConstruction BufferConstructor = new BufferConstruction();
            try
            {
                //Buffer Properties
                IBufferConstructionProperties bcProps = BufferConstructor as IBufferConstructionProperties2;
                bcProps.EndOption = esriBufferConstructionEndEnum.esriBufferRound;
                bcProps.SideOption = esriBufferConstructionSideEnum.esriBufferFull;

                if (string.Equals(endType, "Square", StringComparison.OrdinalIgnoreCase))
                {
                    bcProps.EndOption = esriBufferConstructionEndEnum.esriBufferFlat;
                }

                if (string.Equals(sideType, "1-Sided", StringComparison.OrdinalIgnoreCase))
                {
                    bcProps.SideOption = esriBufferConstructionSideEnum.esriBufferRight;
                    if (string.Equals(directionType, "Left", StringComparison.OrdinalIgnoreCase))
                    {
                        bcProps.SideOption = esriBufferConstructionSideEnum.esriBufferLeft;
                    }
                }

                //Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
                //System.Object obj = Activator.CreateInstance(factoryType);
                //ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;
                //IUnit meterUnit = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter);
                //bcProps.Unit = meterUnit;
            }
0 Kudos
3 Replies
AnnetteLocke
Esri Contributor

Hi,

In the upcoming release, ArcGIS Pro 2.2, the SDK will have a method in the GeometryEngine class that will accomplish what you want to do. It is called SideBuffer, and you will be able to specify round or flat endpoints. 

Thank you for your interest,

Annette 

0 Kudos
MKa
by
Frequent Contributor

Is this the release that is not scheduled until August?

In the meantime, could a solution be to use the offset line geometry engine tool and create a line left/right/both, then somehow create a polygon by filling in the distance between the two lines

0 Kudos
AnnetteLocke
Esri Contributor

ArcGIS Pro 2.2 is scheduled to be released in June.

Your workaround sounds good. 

0 Kudos