Author Topic: How to set ShapeText from Shape Data?  (Read 230 times)

0 Members and 1 Guest are viewing this topic.

chelmite

  • Jr. Member
  • **
  • Posts: 23
How to set ShapeText from Shape Data?
« on: August 12, 2018, 03:48:35 PM »
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

  • Hero Member
  • *****
  • Posts: 762
    • UnmanagedVisio
Re: How to set ShapeText from Shape Data?
« Reply #1 on: August 12, 2018, 05:22:20 PM »
You can try "insert field" (Insert => Field => Formula)

chelmite

  • Jr. Member
  • **
  • Posts: 23
Re: How to set ShapeText from Shape Data?
« Reply #2 on: August 12, 2018, 06:17:44 PM »
On what object/shapesheet/shapesheet category am I inserting this field?

Nikolay

  • Hero Member
  • *****
  • Posts: 762
    • UnmanagedVisio
Re: How to set ShapeText from Shape Data?
« Reply #3 on: August 12, 2018, 07:16:58 PM »

chelmite

  • Jr. Member
  • **
  • Posts: 23
Re: How to set ShapeText from Shape Data?
« Reply #4 on: August 14, 2018, 03:44:51 AM »
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

  • Hero Member
  • *****
  • Posts: 762
    • UnmanagedVisio
Re: How to set ShapeText from Shape Data?
« Reply #5 on: August 14, 2018, 05:27:06 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3282
  • Ideas Visio-lized into solutions
Re: How to set ShapeText from Shape Data?
« Reply #6 on: August 14, 2018, 02:50:19 PM »
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 2007 Std