how to make several objects that will show the same text?

Started by davekatz, September 21, 2016, 11:41:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

davekatz

hello Visio Guy.
is there a way to make several objects that will show the same text, and this text would be changeable?
for example: I created a business card page that contains 16 cards, now I want to change the details on all the cards for the next person but to write just in one place.
thanks Dave.

bmwk100dk

Hello davekatz

Being new to Visio myself, I hope you don't mind me comming with a suggestion. You could attach the data you want to use to the page itself, that way you can reffend it, when ever you want it.

I have attached a small example of what I have done. Hope it is something like, what you wanted.

best regards
bmwk100dk

PS. the file is made in Visio 2013, but saved as *.vsd file

davekatz

Thanks allot bmwk100dk.
that was very helpful and I'll keep investigating.

davekatz

this solution is good for the current page, it didn't work when I copy & paste the shape to another page.
Also, I'm about to plane a process, including multiple objects (valves, motors..) every object has its own properties that I want to show (name, I/OS..).
my main goal is to use several copies of each object in different pages and that all the copies will be synchronized.
I'm sure it got something with DataBase, but I have never worked with those functions.
Thanks & best regards
Dave

bmwk100dk

Hello Dave
Glad you liked my suggestion. Unfortunatly I have no experience having data in an external source, so I can't be of much help there. You could try and search this forum for
databases and stuff like that. I know there is a lot of people here, that knows alot about dataconnections. Hope you can find something usefull.

Best regards
bmwk100dk

Yacine

Hi Dave,
what are you trying to draw? Is it a P&ID? (Valves and Motors)
Yacine


Yacine

In my opinion you'd be better off if you link the shapes on the individual pages to the data source and not between themselves.
Why? Because linking to a data source is a solid proof built-in function. Linking between shapes on individual pages is a custom solution that will bind lot of your time.
So basically, instead of defining a master page to which all the shapes on the other pages link to, you'd have another source witch is the data table ... for all pages the same.

Making the links is also easier, as you can link the shapes automatically by means of an ID - in a PID this would be the tag.
Let my know what you think about.


Back draw is that the input is in Visio's philosophy not the drawing anymore but the external database. You can however overcome this problem by using routines that update the database from the drawing. I've written myself several routines for this task. The best implementation however is probably Nikolay's solution. http://visguy.com/vgforum/index.php?topic=6086.msg24731#msg24731

Regards,
Yacine
Yacine

davekatz

That's exactly what I want to do, but I have no experience in connecting to DataBase.
I'm working with Visio 2003
I want to link the shapes to Excel file and everything I tried didn't work.
Any solution??
thanks again.

Yacine

Yacine

vojo

Yacine, thx for the kind words....though now I deprecated to Visio 2013 (don't get me started)

Assuming you want enter text manually (any automated way will need external links)....you could do this

1)  make page 1 the text input page (or use a background page)
2)  Put say a square
     Open shape sheet
     eventdoubleclick = docmd(1312)
     add section call custom properties  (you can do this from GUI if you want)
     name row = mytext
     close shapesheet
     insert field ==> custom props ==> mytext
3)  double click
4)  put your text in there
Now on page 2, 3,4,5, whtever
1)  make your business card stuff
2)  Open shapesheet of group or whatever
     add section call user....name user.row  lcltext
     in the value cell = page1!sheet1!props.mytext
     <now your business card has the value of mytext in the user cell>
3)  Any child shape need this text can reference parent  child user cell value = parent shape!user.lcltext
4)  for child shape, insert field ==> user.field ==>lcltext

You are good to go

Any double click of page 1 square will:
  - Allow you to enter your text
  - show it on page 1 square
  - and it shows up on page 2,3,4,5 shapes following above.

you can do this for multiples text fields as needed

Some things to consider
  - perhaps you want to pick text based on context:  Use some if then else to pick which text off page 1 to use
  - Perhaps you want hide things sometimes:  on page 2,3,5,  use props.cells instead of user cells and if then else in
    show / hide   (if then else in the geometry show/hide will give control over entire child shape....not just text).
 
Note, should check the exact formats of the formulas cited here...but this concept works fine
This doesn't work cleanly in visio 2013 since docmd(1312) at the top group opens the a different panel than child shapes
(a real pain for old shapes....almost as big the MS bone head stunt of using euler angles instead of quadorians - SP -  for 3D work...talk about not doing your homework!!!).

If you want to get around this, put shape in another shape, group it, put the trigger in the child
   - group level = event double click = if(user.trigger = true, false, true)
   - child shape = childtrigger = if(<group sheet!user trigger> = true, docmd(1312),NA)

the blade shape below should help  (right click and/or double click to see it in action...then surf the shapesheets to see how it all works)

davekatz

#11
thanks allot Vojo and all Yacine, that was very helpful and Impressive.
say I have a master shape object name: 'Valve'. with 3 props.
I use copies of this object in 3 pages.
I want that when I paste this object, it will be asking for a name, and by that name it will know what data to show in the props.
In that way I don't need to look for the shape I want copy in the drawing.
the data can be taken from another page including a table of names & props or from a DataBase.
best regards.
Dave

BTW, what is "lcltext"?

vojo

That is a different question than what you asked originally.   

For that, 2 options
1) you could use a page (probably a backup page) as sort of a DB
     - You need to create a template since you are adding function to the sheets
     - Set up a user section at the page level
     - user cells for all possible info
     - Shape action to push info into the right page user.cells
     - event drop to pull values from page user cells
2) you can learn to love VBA
     - do all of this in the VBA domain
          - keep all info in a VBA data structure (or have VBA reach out to Excell or other for info)
          - Various VBA macros triggered by shape events to accomplish goals (load values, get values, etc)
     - Probably want all the VBA to sit in the stencil so you can pass it others
     - Now here is the kicker (and why I try to avoid VBA):  You and anybody who uses this will need to enable security
          - VBE project
          - Stencil as "trusted" or figure out how to "sign" it
          - etc.

lcltext is the local copy of the text sitting in that given shape.   You will find that doing a single long range reference
creates other maintaince issue with your solution in terms of editing shapes and filling up pages with shapes

davekatz

Hi Vojo.
sorry if I'm off the original question, my purpose is to create modules of components.
Could you please upload an example of your last post?
thanks