Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: Decebal on September 28, 2017, 09:19:26 AM

Title: Connector with colored numbers at both ends
Post by: Decebal on September 28, 2017, 09:19:26 AM
I've created this connector for use in electric wiring diagrams.
This is a special type of connector with labels at both ends.
The labels follow each corresponding end of connector.
The labels have auto-adjustable width up to 14 digits, according to the number of digits of the number displayed.
The numbers are always in sync and equal the connector's Shape Data (Number).
Each digit of the number is displayed on a solid background colored according to the resistor color code.
The connector is double clickable – you can update the number.

I've only continued a little the beautiful hard work of Visio Guy's forum members Wapperdude, Yacine and some other guys I don't remember right now. Thank you all.

If you find other improvements to this shape, please let me know.
Title: Re: Connector with colored numbers at both ends
Post by: Yacine on September 30, 2017, 10:02:07 AM
It is not working with V2013.
You're passing an RGB value as string, which is interpreted as 0.
Title: Re: Connector with colored numbers at both ends
Post by: Nikolay on September 30, 2017, 11:03:10 AM
For me, it's working with 2013
I think this is common language setting problem (most probably, "decimal symbol" is not taken into account).
if you set it to English "." (dot) then it works. With German "," (comma) it does not

Decebal - that's really cool :)
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on September 30, 2017, 07:19:53 PM
Works fine in V2007, English.

Wapperdude
Title: Re: Connector with colored numbers at both ends
Post by: Decebal on February 14, 2024, 10:18:52 AM
I have successfully used this shape for years. However since some time I found that when I drop this shape on my drawing every digit's background turn to black and digit font turn to white.
If I open an existing drawing the labels remain colored as expected until I edit wire number.
It's the same on Visio 2007 and Visio 2021.
Do you have any idea why is that and how can I fix it?
Title: Re: Connector with colored numbers at both ends
Post by: Decebal on February 14, 2024, 10:29:21 AM
Here you have a sample drawing
Title: Re: Connector with colored numbers at both ends
Post by: Surrogate on February 14, 2024, 12:08:35 PM
Quote from: Decebal on February 14, 2024, 10:18:52 AMDo you have any idea why
I have two ideas:
1. Now you use vsdx file format
2. Visio's Themes feature
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on February 14, 2024, 05:33:26 PM
The problem appears to be with your Color List.  It uses lowercase letters for color definition, i.e., rgb.  Replace each with uppercase letters, RGB.  Should resolve problem.
Title: Re: Connector with colored numbers at both ends
Post by: Surrogate on February 14, 2024, 05:43:41 PM
Quote from: wapperdude on February 14, 2024, 05:33:26 PM
The problem appears to be with your Color List.  It uses lowercase letters for color definition, i.e., rgb.  Replace each with uppercase letters, RGB. 
I change to RGB at my side. But I have non-English system, with another delimiters...
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on February 14, 2024, 05:47:07 PM
And 1 other note, the "orange" for color 3 is too red, try 175 instead of 102: "RGB(153,102,51);RGB(255,0,0);RGB(255,175,0);RGB(255,255,0);RGB(0,176,80);RGB(0,112,192);RGB(112,48,160);RGB(140,140,140);RGB(255,255,255);RGB(0,0,0)".  Just my opinion.

@Surrogate:  did that confirm, yes /no?  I did it for 2 of the 1st connectors in the provided file.
Title: Re: Connector with colored numbers at both ends
Post by: Yacine on February 15, 2024, 07:04:08 AM
I tried Wapperdudes idea - replacing the lower case by upper case "RGB". Did not work

However adding a user cell with the formula ( SETF(GetRef(FillForegnd),"="&User.Color2) ) did the trick.
Mind the "=" because otherwise the RGB string would be inserted between double quotes.

"They" must have "optimized" Visio again. ;)
Title: Re: Connector with colored numbers at both ends
Post by: Surrogate on February 15, 2024, 07:56:03 AM
Quote from: wapperdude on February 14, 2024, 05:47:07 PM
@Surrogate:  did that confirm, yes /no?  I did it for 2 of the 1st connectors in the provided file.
In document #1 I see multicolor digits foreground, but when i change number all foregrounds became black! Document #2 have only black foregrounds...

In cell User.Color2 used comma (",") as delimeter. But in Russian system we have semicolon (";").
Value in FillForegnd cell is 0!
If I changed formula in this cell to
SUBSTITUTE(IF(ISERRVALUE(User.Color1),RGB(255,255,255),User.Color1),",",";")it make forecolor different!
(https://surrogate-tm.github.io/gifs/DelimeterIssue.gif)

@Decebal, please try change my formula with Romanian delimeter!

PS This trick also works
Quote from: Yacine on February 15, 2024, 07:04:08 AM
SETF(GetRef(FillForegnd),"="&User.Color2)
Title: Re: Connector with colored numbers at both ends
Post by: Yacine on February 15, 2024, 09:08:40 AM

To implement Surrogate's solution


You may want to iterate over all the shapes of your drawing
for each shp1 in ActivePage.Shapes
  if CONDITION (identify your custom connectors, typically a certain cell has a formula XYZ common to all these conns) then
    grab the label shapes with the same method (other condition)
      now iterate over the shapes of the label
        re-write the formula shpX.Cells("user.Color2").formula = ...


Not sure if it will work, but you may try modifying only one shape, then saving it as master, then replace all the other connectors by this new master.
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on February 15, 2024, 04:16:40 PM
@Yacine:  I assumed that the "=" sign was there.  My comments were directed specifically at the formula syntax.  My bad.
@Surrogate, et al regarding delimiters...
   1) my version uses the inherent Visio English style.
   2) wouldn't the substitute ";" for "," need to be applied at the cell where the list is created, not at a User cell where it is called?
   3) in my reply where I copied the list formula and changed orange value (shown in bold) there are semicolons between RGB entries, and commas within the parentheses.  Is that correct formating for Russian language? 
        >> @Yacine:  presumably, that is  not correct for German language???
    4) I would think the language version would have correct syntax rules, eh?
Title: Re: Connector with colored numbers at both ends
Post by: Surrogate on February 16, 2024, 08:40:16 AM
Quote from: wapperdude on February 15, 2024, 04:16:40 PM
@Surrogate, et al regarding delimiters...
   1) my version uses the inherent Visio English style.
   2) wouldn't the substitute ";" for "," need to be applied at the cell where the list is created, not at a User cell where it is called?
   3) in my reply where I copied the list formula and changed orange value (shown in bold) there are semicolons between RGB entries, and commas within the parentheses.  Is that correct formating for Russian language?
If I use the semicolon separator in the formula, the value in the cells will be clipped to the first semicolon...


User.Color1=RGB(255
(https://i.imgur.com/9EeTavq.png)
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on February 16, 2024, 04:38:50 PM
@Surrogate:  the formula you show has ";" ever place, and that doesn't work.  Plus, i don't see an "=" in cell.  Might you provide the formula that does work for you? 
Title: Re: Connector with colored numbers at both ends
Post by: Nikolay on February 16, 2024, 06:22:55 PM
It seems to be the same as in my repsose (#2) in this thread.

For this the stencil to work, the separator must be set to "." (dot).
In German (or Russian) it is "," (comma) by default, NOT dot.

So this is a language (locale) problem, as far as I can tell.
The stencil can be fixed to work with whatever local setting (but someone needs to put some effort to fix it).
I.e. to ensure the stencil works with whatever list separator and decimal separator are set to. It's not that uncommon to have something non-US there acutally.

You need to change the setting on the screenshot below for the stencil to work. Or use English (US) locale for your OS (this will change that separator automatically), or move to UK or to the USA :)
Just checked five minutes ago, it is still the same as six years ago.

Pleae note taht this may break other things on your system (i.e. it has effect on ALL applications in the system)
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on February 16, 2024, 07:15:18 PM
@Nikolay:  Thank you for the clarification.  It was a bit confusing as to syntax needed for the various language options.  Wanted to be sure it was clear for anyone checking this thread.  As indicated in my replies #7, 9, merely changing to upper case RGB works with same results as your above post shows.  I have no plans to change the delimiters on my system.
Title: Re: Connector with colored numbers at both ends
Post by: Nikolay on February 16, 2024, 11:54:36 PM
@wapperdude it was more to the guy struggling to get it to work actually..
Yes, changing locale is not a good idea but if one just wants this stencil to function that may be the fastest path.

Maybe @Decebal can improve it for us so that it works with any locale (decimal point separator / list separator) if he has some free time, wouldn't that be cool?
Title: Re: Connector with colored numbers at both ends
Post by: manifold1978 on March 19, 2024, 09:35:31 PM
Hi all,
Have been looking for something like this for a while, so very pleased to stumble across this thread!

I'd like to understand how to build something similar from scratch.
I think with my current (limited) undersatnding of shape data I could figure it out, but one thing seems to elude me that this connector does...

It appears to be a group consisting of a connector and the coloured numbers.
If I make a group which includes a connector and anything else, I need to firsly click the shape, then sub-select the connector to move it's start and end points.
This example seems to jump right to the connector part.

Could anyone please give me a pointer on how this specifc bit of fucntionality works?
I feel like I can figure out the rest.

Thank you!
A
Title: Re: Connector with colored numbers at both ends
Post by: Yacine on March 19, 2024, 10:15:31 PM
Yes, instead of grouping the number shapes with a connector, you transform the connector itself first into a group, then you open that group and insert the number shapes.

In the Home Ribbon go to "Arrange", "Group", "Convert to group".
Title: Re: Connector with colored numbers at both ends
Post by: Croc on March 20, 2024, 06:37:50 AM
Interestingly, searching for DECIMALSEP on this forum returns an empty result.
Title: Re: Connector with colored numbers at both ends
Post by: manifold1978 on March 20, 2024, 08:11:54 AM
Quote from: Yacine on March 19, 2024, 10:15:31 PM
Yes, instead of grouping the number shapes with a connector, you transform the connector itself first into a group, then you open that group and insert the number shapes.

In the Home Ribbon go to "Arrange", "Group", "Convert to group".

Thank you!
Title: Re: Connector with colored numbers at both ends
Post by: wapperdude on March 20, 2024, 03:22:29 PM
@Croc: 
QuoteDECIMALSEP
... Not anymore.   :o   ;)