Changing linecolor by shapedata

Started by Syphon, March 30, 2012, 04:18:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Syphon

Hello

I have started using Visio today and for the last 2 hours I've been searching for a way to change the color of specific lines according to data.
Example:
I got a line and when I right-click I have 2 options:
- Aanvoer
- Afvoer

I would like that if the line color changes according to the option I choose, but I can't seem to find the right command for changing the line color :/

Can anyone help me?

Thank you in advance

Niels

Basicly what I am trying to do is:



vojo

Clearest way:

Overview:
Basically add a custom property to the shape...this where you put the andover/anjular/etc values
go into shapesheet and set line color to trigger of the custom property
go to events section and set doubleclick to open custom properties (if you want to just double click the shape to open custom properties)...otherwise dont do it

details:
shape==>custom properties
Define
prop field = infottrigger
prop name = info_trigger
Value = <default>
format = text
save

Open shapesheet (right click the shape)
scroll down to line section
in linecolor cell, put in    if(strsame(props.infotrigger, "andover"), RGB(255,0,0), RGB(0,0,255)
in eventdblclk cell, put   docmd(1312)


Syphon

hmm, first of all I don't know what "andover" is so I put my own value there.
Secondly, I think your version only works when changing the value of the data.
I need it to change when I right click and select "aanvoer" or "afvoer"


Also, could it be that I got visio 2010 and you got an older version?
because my commands are different:
you said: if(strsame(props.infotrigger, "andover"), RGB(255,0,0), RGB(0,0,255)
I would have to enter: if(strsame("andover", props.infotrigger,true), RGB(255,0,0), RGB(0,0,255)

Still trying hard to make it work :/
Sorry for my nooby-ness


Paul Herber

Perhaps Vojo's andover/anjular are supposed to be some equivalent of your Aanvoer/Afvoer (supply/drain in English). No idea which language though

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Syphon

#4
I'm kinda stuck with the actions...

I have set the actions like this
action 1:                        Menu="richting van de lucht"    Flyoutchild=FALSE
action 2:  Action=???     Menu="Aanvoer"                      Flyoutchild=TRUE
action 3:  Action=???     Menu="Afvoer"                         Flyoutchild=TRUE

The problem is what I have to insert in the action :/
I have set the shapedata for sheet.1 (the line, which I called "lijn") with 2 possibilities: "Aanvoer" and "Afvoer".
-> If I change the value of "lijn" manually then the color changes.

Now I need to find a way to link the action with sheet.1

---
I was thinking of
Action1      =SETF("sheet.1","Toevoer")
Action2      =SETF("sheet.1","Afvoer")

But it doesn't do anything :/
It seems that the program doesnt know which sheet.1 to change? (or could I be wrong?)

Things I tried entering in actions:
=SETF("sheet.1",DATA1("Toevoer"))
=SETF("sheet.1",RGB(0,0,255))
=SETF("sheet.1",LineColor=(5))

When I entered:
=SETF("prop.lijn",RGB(255,0,0))
then the entire color changed, almost there ^^

vojo

RE andover......maybe if you got some words, not even english words, that mean something....reader could remember...even chuang for window or whatever would be better

RE formulas and such.....I am not going to do this for you....here is something to play with to see what you need to do

Syphon

#6
Okay: Solved it.


---------------------------------------------------------------------------
The line is called: Prop.Row_1

Actions        Action                                          Menu                      Checked                                    Flyoutchild

Action1                                                           "Lucht richting"                                                             False
Action2      =SETF(GetRef(Prop.Row_1),1)      "Toevoer"                =IF(Prop.Row_1=1,1,0)                True
Action3      =SETF(GetRef(Prop.Row_1),2)      "Afvoer"                   =IF(Prop.Row_1=2,1,0)                True
Action4      =SETF(GetRef(Prop.Row_1),0)      "Reset"                                                                         True

Lineformat

Linecolor    =GUARD(IF(Prop.Row_1=1,RGB(255,0,0),IF(Prop.Row_1=2,RGB(0,0,255),RGB(0,0,0))))
---------------------------------------------------------------------------

Thanks for the help :)