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

Shape Sheet Color Change

Started by IamSpartacuz, November 19, 2024, 11:41:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IamSpartacuz

Hello all,

So I am designing building automation drawings and I came up with a shape that looks like a wire jacket. I added a picture of the different wires I have created. My focus are on the ones that say 2U to 8U, My goal is to have one of those wires and all you have to do is right click and select the wire type then the color and the text change to that wire. Can anyone guide me on how to do this?

Surrogate

#1
This initial article describe how add Actions section for change line weight.

Right now I have not time for more complex descriptions. Also I need more details:
- how many conditions (like 2U, 3U, ..., 8U) you need?
- you need change only colors of text and line, what about line weight?

Thomas Winkel

Read this topic:
https://visguy.com/vgforum/index.php?topic=10302.0
There are examples on how to switch colours with shape data.
It would be easy to extend a context menu.
Personally I prefer a fixed list in the shape data as shown in the screenshot.

You cannot view this attachment.

IamSpartacuz

So I have 5 wire categories, 2U, 3U, 4U, 6U and 8U. Do not need to change the color of the lines just the two areas where you see the color.

Surrogate

Quote from: IamSpartacuz on November 20, 2024, 01:09:51 PMDo not need to change the color of the lines just the two areas where you see the color

Each "wire" is complex shape, which contain some sub-shapes into. Can you share document with example?

wapperdude

#5
I would've thought that Thomas' solution was the approach you're looking for.  By selecting desired type, it changes the color and the text.

Surrogate is also correct.  We need Visio file with simple example that has your actual shape.  Could be a single shape that shows before and after.  Depending upon how it is built will affect the solution.

One other significant consideration...
The Thomas suggestion requires editing the shape to implement.  That may be an issue.  The easiest way would be to edit Masters on the Document stencil.  But there might be some outlier exceptions.  The alternative requires code where you select shape and then run macro to configure that shape.  But, that doesn't require editing any shape to build in the functionality.  Those are the only 2 options that I'm aware of.
Visio 2019 Pro

Thomas Winkel

Quote from: IamSpartacuz on November 20, 2024, 01:09:51 PMDo not need to change the color of the lines just the two areas where you see the color.
It doesn't matter if you need to change line colours, text colours, fill colours, dimensions, font size or any other property.
The procedure is always the same.
Familiarize yourself with the ShapeSheet: Formulas, user defined cells, shape data, actions, etc..
This is really powerful and not too complicated (similar to Excel formulas).

Start with what you need to do anyway:
You cannot view this attachment.
And then, just keep going :D

Btw. set Visio to developer mode, if not already done so:
File -> Options -> Advanced -> Run in developer mode

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: 264 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1139KB.
Tokens: post-login.
Cache hits: 13: 0.00184s for 26,725 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]