How to set ShapeText from Shape Data?

Started by chelmite, August 12, 2018, 08:48:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chelmite

Hi. Certain shapes have shape data:
DevType
Room
DevNum
RequiresPower

I want to:

  • set TheText to Room & "-" & DevType & "-" & DevNum
  • set the bounding box for TheText to if(Prop.RequiresPower, THEMEGUARD(RGB(255,0,0)), THEMEVAL())
I think the bounding box part is easy...it appears to go in LineFormat.LineColor.
Where do I set TheText?

Nikolay

You can try "insert field" (Insert => Field => Formula)

chelmite

On what object/shapesheet/shapesheet category am I inserting this field?


chelmite

Thanks!

Now...is there a way to get more than one displayed. I tried "adding" another text field, but it replaced the first one.

Nikolay

Yes, you can add as many fields as you want..
First select the shape, then start text editing (hit F2), and then use this command.

Alternatively, use Insert Field, "Custom Formula", and type full formula in the input box.

wapperdude

To clarify what Nikolay said, after you insert field, go back to the shape, then, in text mode, place cursor at end of inserted field...hit return to move to start another line. Then, go and do another Field insert.  Note, make sure no text is selected when you do this.  You're merely placing the cursor where you want the next insert to occur.

Wapperdude
Visio 2019 Pro