Author Topic: Turn Fill on and off on a group shape  (Read 829 times)

0 Members and 1 Guest are viewing this topic.

qholmes

  • Full Member
  • ***
  • Posts: 80
Turn Fill on and off on a group shape
« on: March 29, 2018, 03:54:39 PM »
I am using an action to trigger changing the Fill on and off for a group shape. It has a couple of required features. We are using 3D Visioner to have a 3D representation of the shapes. And the Fill On and Off will trigger it to override the transparency and color of the module. Also I want the 2D Visio shapes within the group to change all their fill colors to match the groups fill color when it is turned on.

But what happens.. is if I manually use the Format Shape menu it works. But if I use my Action button it does not. It changes the menu item in Format Shape to No Fill/Solid Fill Which actually works with the 3D, but it does not trickle down to the sub shapes for the 2D visio group shape.

To make the Fill change status I use the FillPattern field.

Thanks for any  help

Q

vojo

  • Hero Member
  • *****
  • Posts: 1251
Re: Turn Fill on and off on a group shape
« Reply #1 on: March 30, 2018, 09:25:02 AM »
manual invokes engine to change all subshapes
Action is a shapesheet function, it only affects the current shape

you could do something like this
- group shape has action (use the checked unchecked cell)
    - Setf(getref(<your action>.checked), if <your action>.checked=1,0,1)
- subshape
    - fillforegnd = guard(if group.xxx!<your action>.checked, 1,0)   //or color X vs color Y

qholmes

  • Full Member
  • ***
  • Posts: 80
Re: Turn Fill on and off on a group shape
« Reply #2 on: April 02, 2018, 07:11:35 AM »
Thanks

I am not quite following this..

- group shape has action (use the checked unchecked cell)
    - Setf(getref(<your action>.checked), if <your action>.checked=1,0,1)   Where am I putting this logic? I get the current value of my actions checked cell. and based on its value set another cell to the same value?- subshape
    - fillforegnd = guard(if group.xxx!<your action>.checked, 1,0)   //or color X vs color YAnd in the subshape for my filled objects I have it reference the group shape and change color accordingly.. ok.. but what is "if group.xxx!" I normally reference the parent object with Sheet.107 or something?

And is there no way to do a recursive change some other way. I really don't like the idea of hard coding it all.. because every time I make a change I have to go through setting it up all over again. What about a Layer change or a Theme change or something?

Thanks for the help.

Q

vojo

  • Hero Member
  • *****
  • Posts: 1251
Re: Turn Fill on and off on a group shape
« Reply #3 on: April 02, 2018, 08:53:09 AM »
this is in the shapesheets of the various shapes

group shape
action cell = setr(getref(action.checked),if 1, 0, 1)

(basically, the action is to check the action.checked cell....if 1 then set to 0, else 1)

Subshape
fillforegnd = if(group!action.checked, group!fillforegnd,)     ///yes ",)"

(basically, if the group shape action is checked, then pick up the color at the group level....else ignore)

BTW, this means you can NO longer use the UI to change colors of ALL shapes in the group.

qholmes

  • Full Member
  • ***
  • Posts: 80
Re: Turn Fill on and off on a group shape
« Reply #4 on: April 02, 2018, 09:00:53 AM »
So I am creating a new Action in my Group object that is checking the other Group action? hehe.. It just seems that I am checking the Checked cell and creating a new reference to something I already have.
I have a Group Action that has a Checked Cell already. So I will just try using the second part to set the color based on the group action checked cell that I already have.
I didn't know I could call on group actions directly.. that is cool. I was always using Sheet references.. this might be better.

I don't want anyone to change any colors any other way anyway.

Thanks I will give this a try this week some time.

I sent a message to Visio Guy for online training.. I have not heard back yet. But I am hoping to get some to increase in my coding knowledge.

Q