Text or Labels in City Engine

9105
24
04-08-2013 08:12 AM
JimJohnson2
New Contributor II
Is there any way to use text or labels to identify the streets, buildings, etc...? Can someone point me to a tutorial or help menu for this.

Thanks
Tags (2)
0 Kudos
24 Replies
AlanKlys
Occasional Contributor

Thanks a bunch for this rule Chris !  Very handy indeed.

I have a hypothetical question ... would it be possible dynamically generate the text based on some attribute values / text etc ?  As in link this to say building height and have it change as the height changes ?

I had a peek at the code but alas it's a little beyond me at this stage. 

PS:  I appreciate the note about the weird push / pop notation ... made me have a look and try to figure it out seems rather handy.

0 Kudos
by Anonymous User
Not applicable

The original file on my blog is updated for the path change.

Regarding building heights in your question: Yes that is possible. Import the 3D text rule into your building rule, and use below notation to set the attributes from your importing rule, then call its start rule which is Generate.

import Text:"rules/3D_Text/3D_Text.cga"

set(Text.Font_Height, yourValueFromTheImportingRuleGoesHere)

Text.Generate

0 Kudos
AlanKlys
Occasional Contributor

Hi Chris,

Your code is spot on and works like a treat, thanks a bunch for your help .... except that my question was not clearly phrased for what I intended, sorry.   What I want to do is put "Height" into the text field then tack another text string to it which is dynamically derived from some attribute, not typed in.  Height in this case.

So if I have a building that ends up generated to 50m I want the line to read "Height 50"  ... is that possible ?

0 Kudos
by Anonymous User
Not applicable

set(Text.Text, "Height " + yourHeightValueHere)

(any of the text rule's attributes can be set in this manner, by the importing rule)

let me know if this helps,

Chris

0 Kudos
AlanKlys
Occasional Contributor

Awesome ... thanks a lot Chris!

0 Kudos
AlanKlys
Occasional Contributor

Thanks.gif

BrettShaver
Occasional Contributor

Hi Chris - I'm having a similar issue.  We are publishing City Engine Web Scenes to be shared online using ArcScene desktop (not using City Engine), and would like a few simple labels.  Is there a way to create textual labels in ArcScene and have them published to the City Engine Web Scene? 

See ESRI white paper reference to our current workflow: http://support.esri.com/white-paper/2018

Thanks!

0 Kudos
MatthiasBuehler1
Frequent Contributor
Well, there's currently no around this .. 😞

Sorry.

And I'm currently really busy, so I have no spare time to help out with this ..

Maybe play a bit in CGA and let me know how you progress.. ok ?

Matt
0 Kudos
MichaelWalton
New Contributor III

Hi, I tested out the rule for 3D text. Want to know if I used it correctly and I have one question.

What I did was draw a polygon over a street and applied the 3D text rule, edited some parameters, and lowered the polygon slightly below the street surface.

My question is, when I export an entire scene should I merge all the 3D text layers as one and export them as the backdrop state? This way the layer doesn't appear in the Web scene table of contents.

Thanks again Chris,

Michael

0 Kudos
by Anonymous User
Not applicable

I'm not sure. That doesn't sound like something that would work. Could you try it and share your experiences with us?

0 Kudos