[SOLVED] Help with linking Shape Data to text box on a new shape.

Started by Kraken Fan # 69, February 09, 2014, 06:33:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kraken Fan # 69

  Hi guys.  Im wanting to create a new shape that will represent a timer from PLC Ladder Logic.  It's just a rectangle that will say "TON" (Stands for Time ON) at the top.  I want to add three text boxes in the rectangle that say Name, Time and Pre.  I would like the user to enter the name of the timer on the shape sheet and append it to the text "Name:".  I tried adding three test boxes to a rectangle and wanted to link the textbox values to the shape data but was unable to find a value to enter the formula.  Am I missing something?  Is there an easier or better way to accomplish this.

__________________________
|           TON                          |
|Name:                                  |
|Time:                                   |
|Pre:                                      |
|                                            |
|                                            |
___________________________

Becomes this after entering values into the shape data window.

__________________________
|           TON                          |
|Name: P-100 Fail To Start       |
|Time:      1.0                        |
|Pre:          120                      |
|                                           |
|                                           |
___________________________

Thanks for any help,

Kraken Fan #69

Thomas Winkel

See attached file.

Hope that helps,
Thomas


@Mods: Would you consider to increase the max. file size to 1-2 MB?

Kraken Fan # 69

#2
  Thanks for the Reply.  I wasn't exactly sure how to do it but had stumbled onto the insert>field thing last night after I posted.  I wasn't getting how to format the text.  Your example gave me just enough to lead me to the answer I wanted and I learned a lot in doing so!  Playing with backgrounds now too.  I've attached what I have came up with so far.  I'll need to make some other blocks to be able to have the flexibility I want.  I would like to be able to add an OTE to the sheet and add the shape data info then add an XIC (Examine If Closed, basically a Normally Open Contact) and be able to "link" it to the OTE to pull date from on the fly. I would also like to fix that the XIO so it asks for the shape data to be filled out when it is added to the sheet as well.  For now this is working pretty good.  If I manage to figure out the "link" thing I'll update this post as well as if I add more componnents.  Could be useful to other PLC Programmers.  Maybe...

Kraken Fan #69

aledlund

My first choice is to try to use what is already in visio. Since you're attempting datalinking, have you considered just a simple datagraphic?
al

Kraken Fan # 69

#4
Um, no.  I hadn't.   In fact I stumbled across that a few times and never took the time to figure out how it worked.  Just spent 10 minutes and can see how that would help.  Thanks for pointing that out!


Playing with it more it's really working well. Much better than what I had done previously.  I like how the graphic will size to the text entered and not overlap the one below.  Just got to figure out a few more formatting tricks on this.


Kraken Fan #69


Kraken Fan # 69

This is the final version I have settled on.  It asks for the shape data to be filled out as soon as it is dropped on the page.

Kraken Fan #69

novski

I have a folow up question to this thread.

I found it realy helpful.

Now im stucked at a certain point. aledlund's drawing (dg_label.vsd) is the only one, that has the data stored on a object inside the Group. Ungroup does not destroy his data. I made my tests upon his sample by setting Shape-sheet- Protection - property - LockGroup to 0.
But my Group does not show the shape-data after clicking once on the group as his does. I have to select the group and then click on the shape that i have all my data set to. Clicking twice is not so clear for a user so im searching for a way to show my shape-data by clicking once.
Does somebody know how to do that?
best regards
novski

edit: going to make a new Thread.
New thread removed [Moderator].

Paul Herber

Ungroup doesn't destroy the data as it creates a new shape containing the data, but the you just end up with 4 shapes (actually more than that as some of those shapes are, themselves, grouped shapes) and those shapes have their own shape data, but set to invisible. Don't ungroup the shape, it breaks.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/