View Full Version : Appending to an expression in annotation template
JeremiahM
2004-07-22, 08:47 PM
I need help figuring out and expression. I am creating an annotation template for parcels that I want to show the APN# and Area in acres. The format of the annotation should be as follows:
APN# xxx-xxx-xxxx
xx.xxx ac.
What I have so far is:
APN# xxxxxxxxx.xxx
xx.xxxxxxxx (created and expression to divide Polyline AREA by 43560.17)
So far I can fudge the the "APN #" by placing it as text before the annotation attribute and left justifying everything, but I would prefer a prefix in the expression so I can use a center justification and I dont know if the hyphenation is possible.
I would like to add a suffix of "ac." to the acerage and limit the amount of decimal places shown.
Thanks for the help,
Jeremiah
mjfarrell
2004-07-22, 09:02 PM
Jeremiah
Is the parcel area in your connected database?
If so that annotation template should select from
DATA, and read from the connected database.
Have the parcels been used to create a polygon topology?
If so then a Topology query would work to place the area Label
at the centroid of the poloygons.
This might be easier to help you set-up if you
sent a small sample of your data, and the connected
database if any.
I would also like to see what you have used, that you believe
will take the polyline area, and perform any mathematic evaluation
of it in an annotation template. As I have experiented with this
functionality, and it causes MAP to return an invalid expression
when editing the annotation template, and results in either no label
being placed or a text string value, like only APN and no parcel number
even when I connect it to the correct database.
JeremiahM
2004-07-22, 09:38 PM
Right now I am grabbing the APN from Object Data and the area from the Polyline area property.
APN Expression: :NO_APN@019_parcel_w_prcl_all_tab
Area Expression: (/ .AREA 43560.17)
Sorry, can't send data.
Jeremiah
mjfarrell
2004-07-22, 10:09 PM
Well in my little world I can grab the APN from the linked database
and the area from the polyline area and this works perfect.
However when I attempt to have it return the area using the expression
(/ .AREA 43560) the annotation template then only returns the TAG value
in my case the number two (2)
And any attempt to append a prefix to the parcel number also causes it to fail
to return the parcel number.
That and an error message when editing the template Unsupported operator specified in expression: /.AREA
Where did you read that you should be able to add to the text field in an
annotation template, or is this something you thought they would do?
I just tested the template again, and I had left a space out after the (/)
so that part works for me now.
Now I am wondering why it wont let me put APN# in front of the parcel number??
Great question!
mjfarrell
2004-07-22, 11:11 PM
Well, I am eagerly awaiting the final on this.
At this time it appears the it will do the math
no problem. Only adding any suffix or prefix text
seems to cause the annotation to fail.
The help file hints at this, only does not explicitly
say that it will not.
Glenn Pope
2004-07-23, 12:03 AM
You can use lisp in the expression. This should work for the area.
(strcat (rtos (/ .AREA 43560.00) 2 2) " AC")
Glenn Pope
2004-07-23, 12:10 AM
Is the APN a real number or integer or character in your object data?
mjfarrell
2004-07-23, 12:50 AM
In my world they are both real numbers
and occasionally they have alpha characters
at the end or beginning. Don't ask me why.
JeremiahM
2004-07-26, 04:20 PM
Thanks Glenn,
That worked for the area, i'm not real educated in Lisp...
The APN OD is the Character Type, I tried to modify what you did with the area formula, but to no avail...
Jeremiah
Glenn Pope
2004-07-26, 05:01 PM
This will get you the APN# in front of the number.
(strcat "APN# " :NO_APN@019_parcel_w_prcl_all_tab)
About the hyphenation
So far I can't get the hyphens. There seems to be a limit of 3 in the number of operations you can do in an expression. To put in the hyphens you need 4. This is the expression needed.
(strcat "APN# " (substr :NO_APN@019_parcel_w_prcl_all_tab 1 3) "-" (substr :NO_APN@019_parcel_w_prcl_all_tab 4 3) "-" (substr :NO_APN@019_parcel_w_prcl_all_tab 7))
This would turn what in the OD "XXXXXXXXXX" to "XXX-XXX-XXXX".
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.