POST
|
Hello Jeff Barrette, Those enhancements sound great and would solve my current problems with text sizing/positioning (assuming these properties can be set with the SDK for programmatically generated elements). With the option to 'Enlarge Box' on 'Only Height', I could create a paragraph text element at the desired width and with a very small height--then the element would automatically set the envelope height to make the text fit. This would also address the other issue I have: How to get size of rendered text? since the envelope would then correspond to the actual size of the rendered text. I hope those changes are in scope for the next SDK release! -Brennan
... View more
05-29-2020
07:05 AM
|
0
|
0
|
937
|
POST
|
I am using LayoutElementFactory.Instance.CreateRectangleParagraphGraphicElement() to create paragraph text in a layout. The method takes an Envelope argument for drawing the text within. Is there any way to determine whether the rendered text actually fit within the provided envelope?
... View more
05-27-2020
07:54 AM
|
0
|
4
|
988
|
POST
|
I'm using LayoutElementFactory.Instance.CreateRectangleParagraphGraphicElement() to create paragraph text elements in a layout. In order to effectively position the generated text, I need to know the size of the text itself. Is there any way to do that? GetHeight(), GetWidth(), etc. all refer to the original envelope, but I want to know how big the rendered text is.
... View more
05-27-2020
07:44 AM
|
0
|
0
|
276
|
POST
|
Hi Jeff Barrette, Thanks for the update. That method will be convenient to have. After working more with text in layouts there are a few more utility methods/options that would be critical to what I'm trying to do, and which I'd expect would be extremely useful to users in general. In order of importance: 1) Option for paragraph text to both wrap to new lines and shrink font size automatically. Currently, the text automatically wraps to new lines, but when it reaches the bottom of its envelope, it gets cut off and shows an ellipsis symbol. It would be extremely nice to set some 'AutoShrink' property to 'true' and have the text automatically wrap to new lines and then shrink the font size until all of the text fits within the allotted envelope. Or, instead of having a boolean setting, a particularly useful way that this option could be implemented would be to have an property on the paragraph text like 'OverflowBehavior' that has some underlying enumeration of choices like 'ShowEllipsis', 'ShrinkFont', 'ExpandEnvelopeHorizontally', 'ExpandEnvelopeVertically'. In this way, a user could control exactly how the text should look without worrying about it being truncated. 2) It would be great to have the same GetBounds() method for paragraph text as you just added for point text, which would return the actual bounds of the drawn text. For instance, I may create a 6" X 6" envelope to draw my paragraph text in, but the text itself ends up being drawn in a 6" X 1.1" space, the GetBounds() method would return the 6" X 1.1" envelope. Currently, if you check the bounds on a paragraph text object, it simply gives you back the original envelope...you have no way to tell how much space is actually occupied by the text. In a situation like mine, where I am trying to arrange multiple text elements with dynamically generated text in a layout such that it takes up as little space as possible, it would be tremendously helpful to know the bounds of the drawn text on the screen. 3) Property on paragraph text that says whether or not the text overflowed its envelope. There is apparently no way to tell whether or not the text overflowed other than visually looking at the layout, where the tiny ellipsis indicator is shown. In my case, I am dynamically creating text elements from code, and want to prevent the ellipsis from ever appearing. Arc Pro obviously has access to this property, since it is showing the ellipsis in response, but there is apparently no way to access it from the API. The underlying problem that all three of these issues address is this: I have the ability to draw paragraph text, but there is no way to ensure programmatically that the text fits within the specified envelope. I also have no way to check how much space the text is actually taking up, and therefore cannot optimize the placement of the text within the layout. I really appreciate your continued efforts to improve the API and hope you consider adding at least one the suggestions above. Thanks again, Brennan
... View more
04-08-2020
09:19 AM
|
0
|
0
|
1276
|
POST
|
Hi Jeff, Your assumption is basically correct: I am allowing a user to set the font styling they desire, and at runtime, I am generating layout elements to display data with that selected styling. After generating these layout elements, I want to ensure that they are placed within a given area on the page and that they do not overlap. I basically just want an Envelope-style object (although I wouldn't care if it was an actual Envelope) in which I can check the X and Y mins and maxes and get back values that correspond to the page coordinates. I would then be able to ignore any kind of rotation that the user decided to apply to text objects and simply look at the bounds of the generated element. I found that paragraph text can work as an alternative, since you can directly specify the envelope that the text must be drawn within, but there are cases where it would be convenient to create point text instead. I appreciate the code snippets and will test those out in the meantime. Thanks, Brennan
... View more
02-27-2020
10:24 AM
|
0
|
0
|
1276
|
POST
|
Thanks for the quick reply. Hopefully a future update will handle this scenario.
... View more
02-26-2020
02:55 PM
|
0
|
0
|
647
|
POST
|
I am attempting to place text within a certain space within a layout. I want the text to automatically wrap to fit within the space, and I want the font size to shrink automatically if the height of the text goes beyond that space. I can specify an envelope and create texts that automatically wraps by creating a paragraph text element like this: Coordinate2D lowerLeftPoint = new Coordinate2D(xPosition, yPosition); Coordinate2D upperRightPoint = new Coordinate2D(xPosition + maxTextWidth, yPosition+maxTextHeight); Envelope textEnvelope = EnvelopeBuilder.CreateEnvelope(lowerLeftPoint, upperRightPoint); GraphicElement renderedText = LayoutElementFactory.Instance.CreateRectangleParagraphGraphicElement(_layout, textEnvelope, text, textSymbol); However, as this link explains, paragraph text does not auto-size to fit its envelope. The link also points out that point text does automatically resize, but will not wrap automatically. Add graphics, text, and pictures—Layouts | Documentation With the code above, I end up with text that will get cut off when it goes beyond the envelope. Pro will add an ellipsis graphic to the end of the text to indicate that it got cut off, but I'm not seeing any property that indicates whether or not the text was cut off. Ideally, I could just set some property to tell the paragraph text to auto-size to fit within the envelope. If such a property does not exist, is there a way to programmatically check whether or not the text fit within the envelope or got cut off? If so, I could manually iterate through smaller and smaller font sizes until the text fits. I'm also open to trying a different approach entirely as long as the text will both wrap and shrink to fit within some specified space. Thanks, Brennan
... View more
02-25-2020
06:35 AM
|
0
|
2
|
713
|
POST
|
I am trying to programmatically determine the bounds (in layout/page coordinates) of a layout element. I see that there are methods like GetX(), GetWidth(), GetY(), GetHeight() on a GraphicElement, but the graphic element may not actually be positioned within (x,y) through (x+width, y+height). For instance, if you create a text graphic element using a CIMTextSymbol whose rotation is set to 90°, the reported width of the resulting element will be greater than the reported height, even though the element is rotated such that it is much taller than it is wide. These methods seem to be returning the size of the element before rotation is applied. I am hoping to get the actual bounds of the element within the page, much like you could get the envelope of a polygon within a map. I could probably use GetRotation() and GetAnchor() along with the X, Y, width, and height to calculate the actual bounds of the element, but I don't trust that rotation is the only other variable that is affecting the actual position and size of the element in the layout. Is there a convenient way to get the 'envelope' for any given GraphicElement in a layout? Thanks, Brennan
... View more
02-22-2020
08:43 AM
|
0
|
5
|
1491
|
POST
|
Thanks for the quick reply, Uma. Yes, we are manipulating CIMSymbols in code as you demonstrate above, and were mainly hoping to tie in a user-friendly UI component so that users could make their own customizations to particular properties of particular elements we are using. It would be extremely convenient if Esri could expose both the controls (like the ArcGIS.Desktop.Internal.Mapping.Symbology.DoubleEditBox) as well as control groups (like the font and symbol styling control groups from the Format Element pane) in the .NET SDK so that we can use them in our own custom dockpanes to allow users to select the exact element properties we are interested in. Thanks again for confirming that such an option does not currently exist.
... View more
02-12-2020
07:55 AM
|
0
|
1
|
607
|
POST
|
I want a user to be able to click a button which will open the style properties for an element in a layout. With a layout open, I can programmatically select the element from the layout (in this case, a text symbol), which will automatically open the ArcPro "Format Text" dockpane. This dockpane has multiple tabs and panels, however, and I'd like to have it automatically open to the "Text Symbol" tab's "Properties" subpanel. Is it possible to do that? Currently, it opens to the Text tab, and it takes several clicks to navigate to the actual font styling properties of interest. I'd also be interested to know if there are other options for editing a layout symbol element's properties. Ideally, I'd like to open my own dialog/dockpane which has the contents of that particular subpanel from ArcPro's properties dockpane, but it doesn't look like that is accessible.
... View more
02-10-2020
08:55 AM
|
0
|
3
|
690
|
POST
|
Just figured this out. Apparently the export only includes features in view at the time that you export; when I zoom out to reveal all of my features, they are all included in the .geodatabase export.
... View more
07-21-2017
08:45 AM
|
0
|
0
|
427
|
POST
|
I am attempting to use Runtime .NET v100.1 to do offline geoprocessing from a .geodatabase file created from ArcMap. I'm using the Share As ArcGIS Runtime Content feature in ArcMap (both 10.4 and 10.4.1), and every time, the .geodatabase file is missing records from my feature layers. It exports the tables themselves, along with the expected fields, but will have an inconsistent and incomplete number of records. For example, I have a Point Feature Layer that has 27 features, but only 12 will be exported. If I try again, I might get 8 features. And again, I might get none. This also happens with Polygon Feature Layers and Polyline M Feature Layers. There is nothing fundamentally different between the records that are included and the records that are excluded, and the particular records that are included change depending on the export. Is anyone else having this problem, and is there a solution? Note that I can successfully do spatial operations such as intersects and buffers with the content that is exported. The problem is simply that the exported data is incomplete. Also note that if I open the .geodatabase file in a SQLite browser, the records really are missing.
... View more
07-21-2017
08:03 AM
|
0
|
1
|
602
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|