Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: visioman6014 on December 13, 2011, 06:19:42 PM

Title: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 06:19:42 PM
Hi All,

Newbie here trying smartshapes AND getting very frustrated. I am trying to toggle the 3 dip switches on the circuit board as seen below and attached. I am trying to use "IF" and "OR" to toggle the FlipX field on the individual shapes. HELP! I am ready to dump this program. :-)
Title: Re: Help - Dip Switches
Post by: Paul Herber on December 13, 2011, 07:06:19 PM
All the shapes in that document have been ungrouped! Assuming you got the DIP switch from this forum then ungrouping the shape will break it. Permanently.
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 07:11:50 PM
Try this file... it's all grouped together with custom properties. Thanks.



Title: Re: Help - Dip Switches
Post by: Paul Herber on December 13, 2011, 07:13:20 PM
but regrouping them doesn't repair them.
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 07:19:32 PM
It's my original file. I haven't de-grouped and re-grouped them. It was done on Visio 2003 as well if that makes a difference. I find the developer documentation for Visio to be minimal at best. MS needs their knuckles cracked for this.

I'm trying to use "=IF(OR(Sheet.94!Prop.INPUT="0-20 Ma",Sheet.94!Prop.INPUT="4-20 Ma"),1,0)" and related IF functions to turn on (flip to the right... "TRUE" (1)) position. But it's taking it as being TRUE all the time.
Title: Re: Help - Dip Switches
Post by: wapperdude on December 13, 2011, 07:27:38 PM
Check out this post:  http://visguy.com/vgforum/index.php?topic=711.0

Go to the bottom of the thread for the latest version which includes 3 different instantiations of the DIP switch: 
    1.  Right click to bring up a menu to select open / closed for each switch
    2.  VisioGuy's adaptation which uses a binary work to set the switches
    3.  Simple mouse to drag control points to set the switch state.

These can be used as is, or, you can examine how they're built to create a custom number of switches.

HTH
Wapperdude
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 07:30:11 PM
I saw those. Thanks.
My question/concern is more akin to the "IF" function coding and if I'm doing it right. I am not an experienced coder at all.

My version uses custom properties (various V/mA input values to drive a variety of dip switch configurations.


.
Title: Re: Help - Dip Switches
Post by: wapperdude on December 13, 2011, 07:35:10 PM
The comparison in the IF statement might work better if you use the string same function.  Check out this reference:  http://msdn.microsoft.com/en-us/library/aa431851(v=office.12).aspx

Wapperdude
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 07:47:30 PM
No, that doesn't do it at all. My 5 variables are all unique.
Title: Re: Help - Dip Switches
Post by: wapperdude on December 13, 2011, 08:01:16 PM
Care to post a sample --  more than just the IF statement?
Title: Re: Help - Dip Switches
Post by: wapperdude on December 13, 2011, 08:13:17 PM
Ooops.  Sorry.  Just remembered you did post examples. 

OK.  Try this syntax:  =IF(OR(STRSAME(Sheet.94!Prop.INPUT,"0-20 mA"),STRSAME(Sheet.94!Prop.INPUT,"4-20 mA")),1,0)

Should work.

Wapperdude

Edit:  updated formula to correct capitalization errors on mA in the provided formula.
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 13, 2011, 08:26:49 PM
Super. Just need a fix up for the "S1" switch which has 3 conditions. what did I miss here as this doesn't sem to work...

=IF(OR(STRSAME(Sheet.94!Prop.INPUT,"1-5 Vdc"),STRSAME(Sheet.94!Prop.INPUT,"2-10 Vdc"),STRSAME(Sheet.94!Prop.INPUT="4-20 mA")),1,0)
Title: Re: Help - Dip Switches
Post by: wapperdude on December 13, 2011, 09:03:31 PM
Syntax error:
IS:  Sheet.94!Prop.INPUT="4-20 mA"
S/B:  Sheet.94!Prop.INPUT,"4-20 mA"
Title: Re: Help - Dip Switches
Post by: visioman6014 on December 14, 2011, 12:12:07 PM
The Wapperdude saved my bacon. Thanks!


.
Title: Re: Help - Dip Switches
Post by: wapperdude on December 14, 2011, 08:38:38 PM
 ;)