News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Connector with colored numbers at both ends

Started by Decebal, September 28, 2017, 09:19:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Decebal

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.

Yacine

It is not working with V2013.
You're passing an RGB value as string, which is interpreted as 0.
Yacine

Nikolay

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 :)

wapperdude

Visio 2019 Pro

Decebal

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?

Decebal


Surrogate

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

wapperdude

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.
Visio 2019 Pro

Surrogate

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...

wapperdude

#9
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.
Visio 2019 Pro

Yacine

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. ;)
Yacine

Surrogate

#11
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!


@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)

Yacine


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.
Yacine

wapperdude

@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?
Visio 2019 Pro

Surrogate

#14
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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 446 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1283KB.
Tokens: post-login.
Cache hits: 13: 0.00150s for 26,725 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]