I can think of two ways to do this:
1) Using object data (OD is captured using the MAPIMPORT command on a shapefile--where the
Object Data is harvested from the shapefile's attribute data)
2) Keep the shapefile and compose a label, or an expression, from its attribute data using
MAPLABEL2ANN command found in Annotate tab=>Map Annotation panel. (Maplabel2ann is the
official command and IDK why the button's name on the ribbon is 'Label to Text').
Using #1 you'll be dealing with drawing objects and mtext. Using #2 you'll be in 'map feature'
environment when writing the expression, then once the expression is a feature label, you'll take
the label and convert it to mtext.
Using #1.
THE GOOD: Has advantage of working with Cad objects and mtext. Layer management for color, on
& off, line weight, etc through layer properties palette. The shapefile never touches
modelspace, it's only used to import line work and harvest attributes. You can also use OD to
create an 'annotation template' (MAPANNTEMPLATE command) to easily format your single line label.
THE BAD: Insertion of your queried OD text is whacky. If you bring in more than one piece of text, e.g.
length, diameter, material, they are placed on top of one another. Yes, you can control the
text, but from experience I've found the control to be limited when your text is queried
directly from OD. No, I'm not saying there's anything wrong with OD, I'm just saying
it may not be appropriate to use as a source for labels. Another bad is what you already know:
decimal precision. I can't find a way to control it either. It defaults to the precision in the
shapefile's dbf. Don't forget, a major part of Cad is control using layers, styles,
properties, and in this case, object data. Also, when using MAPANNTEMPLATE, I could edit contents
in the template, but I couldn't control the global precision of the decimals.
Using #2.
THE GOOD: You compose the label from the attributes in the shapefile using CONCAT. This
function is where you join two or more pieces of attribute data (the expression builder calls
them properties) and other parameters, i.e. decimal precision, into one line. After the
feature label is formatted, you'll convert the those labels into mtext, where you have
control. Don't forget, this single line mtext line can also be squished narrow and
be two or three lines instead of just one, after all, it's multi-line text.
THE BAD: You'll have to compose the expression and you have to connect to the shapefile using
FDO in order to do so. Once the features labels have been converted to mtext, you are free to
delete the shapefile from the task pane and disconnect it in FDO, which will just leave you
with the converted mtext. Of course you'll lose your line work but you can still bring it back
in again. The second time though, use MAPIMPORT and bring it in as a Cad object rather than a
map feature. Despite all this, I prefer using #2.
You can watch the video >>HERE<< to see how.
Notes:
- This demo uses a shapefile and Map 3D.
- The demo uses a parcel shapefile but you can apply the principles to other shapefiles as well.
- In the Create/Modify Expression builder uses the Text Function CONCAT to create a single line label with multiple properties (attributes). A space was used to separate the 3 attributes, IDPARCEL, Shape_Leng, and Shape_Area. The space was inside single quotes.
- To control the number of decimal places, Math Function ROUND was used to reduce it down to 2-places.
- If you want to keep the yellow halo on your labels, you can skip the last part where the labels are converted to mtext. Although you can use a 'mask' on mtext, the halos are only possible as map feature labels e.g. shapefiles and sdf's.
- To determine whether your expression has errors, hit 'validate' in bottom left of expression dialog. It won't tell you what the error is, it only tells you where it is.
- You may also add 'static' text in the expression, e.g. 'Perimeter=' or 'Sq Ft=' by inserting them next to the spaces which separated the labels making sure the static text is inside the single quotes.
- Despite some limitations, map anno template may also be a viable alternative. I was able to control layer, text height, text style, text rotation, and text placement. I was not able to control decimal precision.
Chicagolooper
