Main Menu

Recent posts

#41
General Visio / Re: Visio smart shapes losing ...
Last post by Nikolay - April 22, 2024, 12:46:08 PM
You specify the key columns yourself when you link the data. Just select your two columns there. Here:



Am I missing something? Maybe you are using "Quick Import" from Excel? Use the standard one to set options (It's called "Custom" now)
Or edit them afterwards, using the "Edit Data Source" context menu.
#42
General Visio / Re: Visio smart shapes losing ...
Last post by visio - April 22, 2024, 11:27:49 AM
Have deleted duplicates in shape data and have tried to add in the correct properties from the excel sheet.

So there are 7 columns in the excel sheet and 7 entries in the shape data. Shape links fine to the data but using a double key so in the example about SSN and Salary must both match so that makes thing unique.

When trying the data refresh yet again the link gets removed.

Is this an issue in the Shape data?  How is the data source selected correctly so shape data would be prop.mydata_SSN for data with a label of SSN. Typing htis in freeform and visio complains
 
#43
Programming & Code / Updating shape props programma...
Last post by Helkost - April 22, 2024, 11:26:33 AM
Hello,
I am developing an application in c# which converts an excel file with an elaborate dataset into a visio document.

Just for context, the excel file lists a certain amount of PCs, Switches, Extenders, complete with their network, graphics and datapath ports, and all their cable data (therefore showing for each used pc port its destination).

So, I managed to make the whole part about generating the visio document (also thanks to John's amazing blog and this forum) but I am being stumped with the update function.

The update is as follows: the user, after generating a visio document, might change some information - i.e. the number of datapaths on a PC, maybe also remove some connections, etcetera, and will then need to update the generated Visio accordingly.

Given that the previously generated document might be quite complex and the user may already have manipulated some connections by hand to make them look nicer and easier to follow, we only want to update the shape that is being changed while leaving the rest untouched.

Since one of the possible changes that might happen is the deletion of a shape, I access the Visio.Page shapes in a for loop counting backwards:

       Visio.Page visioPage = CurrApp.ActivePage;
            for (int i = visioPage.Shapes.Count; i > 0; --i)
            {
                Visio.Shape sh = visioPage.Shapes[i];

                [...]
            }

after a few checks, I want to update the actual shape "sh":

                //data is a dictionary containing current excel dataset.
                if (data.ContainsKey(sh.NameU))
                {
                    _ = data.TryGetValue(sh.NameU, out var excelShape);

                    excelShape.UpdateShapeData(ref sh);

                    data.RemoveShape(sh.NameU); //shape has been processed
                }
                else
                {
                    RemoveConnectorsFromDictionary(sh.Shapes);
                    visioPage.Shapes[sh.NameU].DeleteEx((Int32)Visio.VisDeleteFlags.visDeleteNoHealConnectors);
                }

UpdateShapeData is a function which accesses Visio.Shape cells directly and updates their FormulaU, and eventually, remaining shapes in excel dataset will be added to current page.
None of this is giving me any error, but at the end of the whole thing, the document is not updated - no new shapes, shapes no longer existing not removed, etcetera. the only thing I can think of is that I'm working on copies of the actual shapes on the document.

FYI, part of the routines that I use (for example to drop new shapes) are the exact same routines I use to generate the visio document, and in the "generate" case they work perfectly.

Any clues on what I might be doing wrong ?

#44
General Visio / Re: Visio smart shapes losing ...
Last post by Nikolay - April 22, 2024, 10:57:22 AM
That looks that you have a problem with IDs.

How are the shapes matched against Excel rows? You need to have some field (excel column) that would identify a row from which to take data for the shape in Excel (that will not change between refresh operations). Looks like you are using some field that has the same value for all shapes.

Example:

SSN | Name | Salary
001 | John | 100
002 | Jack | 100
003 | Ted  | 100

If you use "Salary" as a key column, that would not work: all salaries are the same, Visio will not know what row corresponds to what shape.
You should select "SSN" (best) or "Name" (second best) as a key in the example above.
#45
General Visio / Re: Visio smart shapes losing ...
Last post by visio - April 22, 2024, 10:43:16 AM
Not that I can see. when the shapes are auto re-linked they absorb the data fine then reposition themselves accordingly.

When a data refresh is carried out after successfully linking the shapes the following message is seen

'The following shapes were linked to rows that could not be uniquely identified during refresh'
 
Is there any log or something that can be checked in visio?  Weird that the shape links automatically fine but then this  link is removed on refresh.
#46
Deployment / Re: Online Shapes Library
Last post by Nikolay - April 19, 2024, 09:06:00 PM
I have read that CERTUM provides that, but never tried myself:
https://www.certum.eu/en/code-signing-certificates/
Looks like not for free, but still times cheaper than $250. Looks like they ask for just $25 (if you are developing open source and already have a compatible device to save the certificate - from 2023 physical device is mandatory)

BTW, usually hosting prices like $4 per month are promotional prices; I would watch out for the renewal ;)  (i.e. for the next year)
#47
Deployment / Re: Online Shapes Library
Last post by Thomas Winkel - April 19, 2024, 08:44:11 PM
Quote from: Paul Herber on April 19, 2024, 04:55:36 PMI'm so far outside the loop these days that I don't even know what this means.
Not sure if I use the terms correct, but Docker is a virtualization technique that allows to encapsulate server processes. Sounds complicated, but makes things much easier.

Quote from: Nikolay on April 19, 2024, 07:01:26 PM- a domain name ($15 annually)
- a hosting that supports python, i.e. that "dockerized server in the cloud" ($60 annually)
- a certificate to sign the add-in ($250 annually)
Here we go :P:
https://www.visio-shapes.com/
Server: 4€ / Month (4GB ARM64)
SSL certificate: Gratis (Let's Encrypt)
Domain: I don't know (part of my hosting package)

I added the first shape.
Lets see if the server is still running next week, and how many shapes were added... :D

Requires the current AddIn from Github.
For drag & drop the connection is too slow. Sometimes it works, sometimes not.
I think we have to provide an alternative way to paste shapes from the server.

Edit:
Ah, to sign the _add-in_
Damn, that is expensive!
Is there no other option for open source projects?
#48
Deployment / Re: Online Shapes Library
Last post by wapperdude - April 19, 2024, 07:48:35 PM
There's a loop???  I can't even do hula hoop any more.  🤕
#49
Deployment / Re: Online Shapes Library
Last post by Nikolay - April 19, 2024, 07:01:26 PM
I guess to make the whole thing functional, one would need:

- a domain name ($15 annually)
- a hosting that supports python, i.e. that "dockerized server in the cloud" ($60 annually)
- a certificate to sign the add-in ($250 annually)
#50
Deployment / Re: Online Shapes Library
Last post by Paul Herber - April 19, 2024, 04:55:36 PM
Quote from: Thomas Winkel on April 19, 2024, 02:17:48 PMa dockerized server

I'm so far outside the loop these days that I don't even know what this means.