go through all reference to apply data to shapes

Started by kiler40, December 09, 2013, 06:06:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

Hello All,
i`ve manage to understand how to link data to visio, but now i want dis data to become more "smart", and i think this involves some coding... but here i`m really poor of knowledge
Here is a simple example of it.
In the attached file there is shape that represents a fuse that is placed in a fuse box with number 349 and in different references (ref1, ref2... etc) the fuse is in different position (s1, s2...), and when the fuse have an option "used" that is linked to the reference with "1" it is visible.
The idea is that in one page i have 5 fuse boxes with 50-60 fuses and within 70 references with different combinations.
I want to create a cycle that automatically link data to shapes but related to a reference, in the box that says "reference" displays the name of the reference, save it as PDF and go to the next reference.
And all this needs to be flexible. I mean like automatically link. Connect  all row to all shapes that meets the criteria.
I hope this is not too much to ask , and in the same time not too complex because i`m not good in coding.

Thanks for the help.




Nikolay

#1
Hmm.. Did not quite get the whole thing.
Could you probably describe a you idea in other terms..? I.e. why do you need to do all this (and what exactly)?

I mean, you have fuse boxes. And fuses. Which can be put in those boxes. That's clear  :)

Can you probably start from here? Do you want to draw them in Visio? Export to PDF? Or to Excel? Or what do you want to do with them? What is this excel file?

Surrogate

kiler40,

I don't understand what you need, because learn English in school 987 (Moscow)  ;)
Please describe your ideas in Russian (in russian forum or in personal message)


Evgenyy

Да смените же раскладку, тут все свои  ;D

kiler40

Hello All,
And sorry for not being clear.
I have a "smart" shapes /in this situation fuses/ that are positioned in a fuse box connector /in this case called 349/
The smart shape have properties of "connector" to know witch of the connectors in the page /if there is more than one/ it is relayed to.
It also have "position" to know where in the connector it is placed.
The last option that the shape have is "used". If it have values of 1 or 0 it is either visible either not.

There are different references (ref1, ref2, ref3...) in witch different fuses are used. In the picture i`ve shown only one but in reality it can be 100-200.
And in different combinations different fuses are used.
FOR EXAMPLE:
ref1
     -fuse on position s1
ref2
     -fuse on position s2

BUT !
if i link the data row by row it copy all the row options (in she shape data window you can see that instead the 3 options you have also the ref1, ref2, ref3...  and these I don`t want.

I want a cycle that goes through all reference, displays fuses witch positions are marked with "1" in the "ref" column, saves the result /the whole page/ in PDF and do the same for the next ref.
And this need be not for 6 fuses and 6 references, but unlimited /100-200 fuses and references/

Hope this gets more clear.
I`m not sure if this topic is not related to the "ShapeSheet & Smart Shapes" section of the forum, but i`m pretty sure that this will not go without coding.

Thank you for Your time !






Evgenyy

#5
Thanks to Google for providing a translator .
Data Binding Excel and Visio, in my opinion, does not lead to anything .
However, if you thought about the implementation in VBA, then there will be more opportunities immediately .
As I see it , you can create some shapes of these black boxes and red squares , then calculate the coordinates of the insertion of the first black box , and place it on a sheet of cycle all the boxes increasing coordinates , get some array , one-dimensional or two-dimensional , it's your choice .
Then just place the shapes of red squares and save the results on the server ...
How I would implement : would write VBA code in Excel and Visio ... I think this way is more resistant to change and be able to evolve .
If I wrote is not offtopic , we can continue the dialogue , only a minimal knowledge of programming necessary.

Just do not understand the process of creating the project, if the file is only created for the Excel data entry is in my vision at all implementing it disappears as an unnecessary link.
If these black boxes will need to print and then another, I think a lot of them on a piece will not fit, then you can put one box on the sheet (or file) and the number of sheets (files) to create, depending on the initial data ... the problem is further simplified .
But you can not simplify all customer requirements are feasible provided the use of VBA.


PS At the Russian forum , which is written in the signature Surrogate , personally I would be more comfortable to chat )

Спасибо гуглу за предоставленный переводчик.
Связывание данных  Excel и  Visio, на мой взгляд, не приведёт ни к чему.
Однако, если ты задумались над реализацией в VBA, то возможностей сразу станет больше.
Как мне видится, можно создать некие shapes этих чёрных коробок и красных квадратов, затем вычислить координаты вставки первой чёрной коробки, и расставить на листе циклом все коробки, приращивая координаты, получится некий массив, одномерный, или двухмерный, это на твой выбор.
Затем так же расставить shapes  красных квадратиков и сохранить поулченый результат на сервере...
Как я бы реализовывал: писал бы код  VBA в Excel и  Visio... Мне кажется, этот путь более устойчив к изменениям и способен развиваться.
Если я написал не оффтоп, то можем продолжить диалог, только минимальное знание основ программирования обязательно.


Точно не понятен сам процесс создания проекта, если сам файл  Excel создаётся только для ввода данных то в моём видении реализации он вообще отпадает, как лишнее звено.
Если эти чёрные коробки нужно будет затем ещё и распечатать, мне кажется, много их на лист не поместишь, тогда можно ставить по одной коробке на лист (или файл) а количество листов( файлов) создавать в зависимости от исходных данных... задача упрощается ещё больше.
Но можно и не упрощать, все желания заказчика осуществимы при условии использования VBA.


ЗЫ На российском форуме, который написан в подписи Суррогата, лично мне было бы комфортнее общаться)

Nikolay

Hi, thank you for clarification.
Please correct me if I am wrong, do I now understand the task correctly:

You basically want to draw a diagram(s) which represents a fuse box(es), then put fuses in some positions in that fuse box (by hand),
and then generate a report (PDF?) out of that, describing which fuse position is filled (a table and a picture)

Is it correct?

kiler40

#7
Almost.

QuoteYou basically want to draw a diagram(s) which represents a fuse box(es), then put fuses in some positions in that fuse box (by hand)
Yes and assign to them the positions in VISIO.

Then from a excel file with different reference (combination number let say it other way) to visualize in the exact combinations witch fuses are active (present in the box). And from this to export a picture of the page
And this to be as a cycle to go through all combinations.
(i`ll attach 2 pictures combined into one to represent actual result)

Evgenyy -
i know the position of the fuses. i just want to have them visible/invisible depending on the combination that is displayed.

Surrogate

I think best practice put your code in single application. I prefer Excel

Evgenyy

#9
i know the position of the fuses. i just want to have them visible/invisible depending on the combination that is displayed.
you can just make the presence or absence thereof.
As I understand it, in one slot may be different fuse ... You're going to put them all in one place, and then make it visible only one? Simply choose from a set of one shape shape and insert it into the right place.. Only now it seems to me that the file of Excel vary slightly from above, for example, were the first and only edinichki no data, it will be red or yellow fuse.

так можно просто сделать присутствие или отсутствие оных.
Как я понял, в одном пазу может быть разный предохранитель... Ты собираешься все их разместить на одном месте, а затем делать видимым только один? Проще выбрать из набора элемента один шейп и втавить в нужное место. Только теперь мне кажется, что файл ексель слегка отличается от представленного выше, ибо в первом примере были только единички и нет информации, будет это красный предохранитель или жёлтый.

Nikolay

Okay,

So you have a fuse box, where you have named fuse positions (and fuse boxes are also named)
And you have an excel sheet, where you have a matrix which defines, which position of which fuse boxes should be filled (one "ref" column defines one "layout")
And you want to visualize each of this "ref" combination (and export the result as PDF).

Correct now? :)

If yes then I think you could follow the advice from Surrogate - most probably it would be easier for you to do a bit of coding (in VBA or whatever) to complete the task.
I.e. the built-in "data binding" in Visio was not designed to work for a "matrix" - like source, I'm not sure if it is possible to "bend it this way" :)

kiler40

yes exactly. it is a matrix.
and the explanation "Visio is not design to work with matrix" pretty much kills it all :D

I`m not good at coding. Unfortunately :(
that`s why i`m asking here.

Nikolay

Nah, that's no big deal. I think we will be able to help you out :)
Will be able to provide a more detailed info later today when I get home.

kiler40

Thanks for that :)
And by not good at coding i men - i don`t get almost a thing  :-[

Surrogate

killer40,

if i understand you have chassie, with few shelves (like as 349, 350 etc), in these shelves may placed some kinds of fuses 3, 5, 10, 25 etc ?
Can you send datasheet for your device ?