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

## SHAPE PROGRAMMING

Started by DAVEDEWEY, September 28, 2017, 06:56:43 PM

0 Members and 1 Guest are viewing this topic.

#### DAVEDEWEY

Had a great response to my last post now have shapes that I sort of know how to make intelligent,, is there a good guide or quick view list of commands variables that can be added to smart shapes anywhere

#### Surrogate

You need learn ShapeSheet basics!
For example Understanding the ShapeSheet

#### wapperdude

Add another reference in addition to Surrogate's:  https://msdn.microsoft.com/en-us/library/office/jj945061.aspx

Wapperdude
Visio 2019 Pro

#### DAVEDEWEY

hey guys thanks for that sort of getting there I think

so I have 4 menu items saying
open
closed
earth in
earth out

open and close works lovely changing colours as i need, there is then part of the shape that stays white untill i select earth in

=IF(Sheet.5!Scratch.A1=1,THEMEGUARD(RGB(0,0,0)),THEMEGUARD(RGB(0,0,0)))
=IF(Sheet.5!Scratch.A1=0,THEMEGUARD(RGB(0,0,0)),THEMEGUARD(RGB(0,0,0)))

=IF(Sheet.5!Scratch.A2=0,THEMEGUARD(RGB(0,255,0)),THEMEGUARD(RGB(0,0,0)))

as you can see im using scratch, i think the real problem is that im using lots of ifs any ideas please

#### wapperdude

There's a lot of information missing.  Difficult to help.  Easiest would be to upload your shape.

But...
Under what conditions does the shape stay white?  How are those conditions defined?  The sheet.5!scratch cells???  Under what conditions does the shape change to some other color?

Where are the IF statements located...what cell?

The 1st two IF statements do the same thing regardless if the test condition is true or false.  Thus, they are not necessary as is, and you might as well hardcode the RGB value.  Only the 3rd IF statement does something meaningful.

Wapperdude
Visio 2019 Pro

#### DAVEDEWEY

The shape in the attached "HV BREAKER" has menu options closed to supply, open, closed to earth, open

Closed to supply the shape remains red the earth is not shown
Open shape turns black earth not shown
Closed to earth shape remains black but earth symbol shows going from white to green
open was to remove earth but in fairness this could go white if either of the first two were then pressed

#### Yacine

Can you show each combination individually?
Yacine

#### DAVEDEWEY

For sets copied here in real terms there is no needs for open from earth as this could be a toggle of closed to earth or open from supply

#### Yacine

Nut sure whether I got every thing right ... check the attachment.

The things I modified:
- scratch section
this is fine, but not really needed. This section has several columns, one can use for properties (A and B), coordinates, etc.
In your case, you're just looking for a boolean checked/not checked, so I replaced the scratch cells by user cells. A pure "esthetical" issue.

- the sub shapes were far too complex, I replaced them by 2 shapes.
Yacine

#### DAVEDEWEY

thats very good thank could i ask what section do i find you formulas in

#### wapperdude

#10
For Yacine's shape, there are formulas in the Actions section at the toplevel, group shape.
There is a formula in the LineColor of the Supply subshape, and a formula in the LineColor for the Earth subshape.  These are controlled by the User.Supply and User.Earth entries in the toplevel group shape.

In the attached, a variation is provided to show further possible consolidations.  As shown, the Supply and the Earth shapes, have reduced geometry sections.

In addition, the overall structure can be reduced from the current group plus 2 subshapes to a group and one subshape.  The trick is to convert the Supply shape to a group.  All of the Actions are still part of the group as before.  Except for the fact that the Earth has a unique color, the entire structure could have been done in a single shape using appropriate geometry sections to control on/off visibility.  But everything would have identical colors...when black, all lines are black, when red, all lines are red.

Finally, for hiding the Earth subshape, rather than changing it's line color, I use the Geometry1.noshow cell.

Mostly, the idea was to show that a lot is possible via the shapesheet.

Wapperdude
Visio 2019 Pro

#### DAVEDEWEY

These are really good guys, so what would the easiest way be to prevent the earth showing if the shap is closed to supply

#### wapperdude

Just to be clear, whenever the closed supply is shown, you never want the earth symbol to show?  Then, assuming there are 2 scenarios that hide the earth symbol...

In the shape I provided, you can use an OR statement inside the IF in the Geometry1.noshow cell.  Since "true" or "1" hides the geometry, something like =IF(OR(A,B),1,0), where A is the closed supply condition and B is the no earth condition.

The same IF statement approach would be true for Yacine's development.

Wapperdude
Visio 2019 Pro

#### DAVEDEWEY

i will have a go cheers guys

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: 390 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1208KB.