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

Change Line Pattern with User Info

Started by drewdb, September 29, 2008, 03:32:44 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.


Hi to all.

What i've got:
I've got a shape that is a line that represents a cable used in Audio/Visual.
When the user drops it on the drawing a pop up asks for the length required then another popup from the database so they can select the type of cable it will represent. This all works well.

What i'm trying to do:
I'm trying to work with the shapesheet and indexes to allow for different line patterns depending on the type of cable they have selected from the database. I gather i need to use "If" somewhere to condition the value of my Prop.Model to then change the line pattern but i'm not sure whether i can do this in shapesheet or where to start.

Any help would be great. Thanks.


Line Format -> Line Pattern, in the ShapeSheet, make this change depending on the prop.model and your good to go.
I guess you just need to play around a bit to find out what exactly the value should be to get your own custom line pasterns. standard ones can be used by setting the value to 1,2,3 etc.

Sounds like you got a nice template going, good luck!



Thanks for that. that got me in the right direction.

i added: IF(STRSAME(Prop.Model,"TCF8-24BK/WH"),SETF(GetRef(LinePattern),1),0)+IF(STRSAME(Prop.Model,"CAT6"),SETF(GetRef(LinePattern),2),0) in a user cell and all works well.

there are only around different cable types we use so it will be easy to manage.

Thanks again.

Visio Guy

Another tip or two...

Your Prop.Model is probably a fixed drop-down list (Type 1). In the cell Prop.Model.Format, you probably have semi-colon-separated list like this: "TCF8-24BK/WH;CAT6;OtherLine"

You can find out which item is currently set using the LOOKUP ShapeSheet function:

User.modelIndex = LOOKUP( Prop.Model, Prop.Model.Format )

You can then flip this and choose a pattern name, using the index returned in User.modelIndex:

User.patternName = INDEX( User.modelIndex, "Pattern1;Pattern2;Pattern3" )

For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


Thanks again,

the Prop.Model.Value is selected from a Database Record when the user drops the shape onto the doc. it doesn't have a lookup list or anything. i'm not sure, but could this be similar?

Visio Guy

Ah, you're getting it from the database. Ok. The LOOKUP and INDEX formulas might be useful in some otherway, anyway. You don't have to have a list in Prop.Model.Format, you can put lists anywhere, and lookup values from them as needed.

The reason I brought this up is that your formula is really, really long, and these two functions can make it all a bit easier to read, maintain and develop.
For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


Very Very long indeed.

I'll head in the direction of using lookups.

While i'm thinking of it, there are also quite a few cable types that i'm using the same line pattern for, is there a command like "leftstring" or something that i can use if(statement) once for and gather these ones into one line?

Visio Guy

There's a pretty full set of standard string functions for the ShapeSheet, so you should be able to get substrings and do manipulations using LEFT, MID, RIGHT, SUBSTITUTE, STRSAME, LEN, REPLACE, REPT, and so on.

But again, using Index and Lookup, you might be able to say something like "if index is between 3 and 7, use pattern A"
For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


Very good point!

I'll start heading in that direction then.

Thanks again. i'll let you know how i go.

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: 299 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1126KB.
Tokens: post-login.
Cache hits: 13: 0.00148s for 26,764 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]