issues with custom line ends

Started by perry59, May 16, 2021, 06:50:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

I've designed a custom line end to represent "stowed" wires in aircraft wiring harnesses.
If I apply it to both ends of a connector, one end gets flipped on the horizontal axis, how do I keep both ends with the same orientation? i.e. the loop facing down? (see attachment).
Also, it seems the only way I can keep this line end always available is to have it in a stencil, but what if a user does not have that stencil loaded?
do I define it in ALL my stencils? doesn't seem like a good idea to have multiple definitions of the same thing. Are there other options?
Lastly, how do I apply the line end via code? my line end is the last entry (46th) when using the visio UI but if I call it with that number nothing happens, or if I call it via its name I of course get an error, how do I do this?


If isStowed Then
' "stowed" is the 46th entry in the list, but if I put 46 nothing happens, if I put "stowed" I get an error
vsoShape.CellsSRC(visio.VisSectionIndices.visSectionObject, visio.VisRowIndices.visRowLine, visio.VisCellIndices.visLineBeginArrow).FormulaForceU = "5"
vsoShape.CellsSRC(visio.VisSectionIndices.visSectionObject, visio.VisRowIndices.visRowLine, visio.VisCellIndices.visLineEndArrow).FormulaForceU = "5"
End If
what, me worry?

Surrogate

#1
Quote from: perry59 on May 16, 2021, 06:50:33 PM
Also, it seems the only way I can keep this line end always available is to have it in a stencil, but what if a user does not have that stencil loaded?
User without this stencil cannot apply these line ends in own documents !
Quote from: perry59 on May 16, 2021, 06:50:33 PM
Lastly, how do I apply the line end via code? my line end is the last entry (46th) when using the visio UI but if I call it with that number nothing happens, or if I call it via its name I of course get an error, how do I do this?
42 46 is Ultimate Question of Life line ?

Paul Herber

Quote from: Surrogate on May 16, 2021, 10:03:15 PM
Quote from: perry59 on May 16, 2021, 06:50:33 PM
Also, it seems the only way I can keep this line end always available is to have it in a stencil, but what if a user does not have that stencil loaded?
User without this stencil cannot apply these line ends in own documents !
Quote from: perry59 on May 16, 2021, 06:50:33 PM
Lastly, how do I apply the line end via code? my line end is the last entry (46th) when using the visio UI but if I call it with that number nothing happens, or if I call it via its name I of course get an error, how do I do this?
42 46 is Ultimate Question of Life line ?

Answer!

How many rows must your code read from
Before you generate a fault,
How many shapes must you add to a page,
Before you make it a group,
Yes, and how many times must you select a shape
Before they're forever filled,

The answer my friend is written in C#
The answer is written in C#



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

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

perry59

apparently my link to visio guy is redirecting me to comedy central.
hope it gets fixed soon
what, me worry?

wapperdude

#4
Just the facts...
QuoteIf I apply it to both ends of a connector, one end gets flipped on the horizontal axis, how do I keep both ends with the same orientation? i.e. the loop facing down?
You need two separate designs.

QuoteAlso, it seems the only way I can keep this line end always available is to have it in a stencil, but what if a user does not have that stencil loaded?
Actually, the custom end belongs to the file, save as template.

QuoteLastly, how do I apply the line end via code? my line end is the last entry (46th) when using the visio UI but if I call it with that number nothing happens, or if I call it via its name I of course get an error, how do I do this?
In the example below, RtDwnHK was the name of the custom line end.  Macro recorder actually got it wrong.  Here's correct syntax:

ActiveWindow.Selection(1).CellsSRC(visSectionObject, visRowLine, visLineEndArrow).FormulaU = "USE(""RtDwnHk"")"
Visio 2019 Pro

perry59

Quote from: wapperdude on May 18, 2021, 12:53:12 AM
Just the facts...
QuoteIf I apply it to both ends of a connector, one end gets flipped on the horizontal axis, how do I keep both ends with the same orientation? i.e. the loop facing down?
You need two separate designs.

QuoteAlso, it seems the only way I can keep this line end always available is to have it in a stencil, but what if a user does not have that stencil loaded?
Actually, the custom end belongs to the file, save as template.

QuoteLastly, how do I apply the line end via code? my line end is the last entry (46th) when using the visio UI but if I call it with that number nothing happens, or if I call it via its name I of course get an error, how do I do this?
In the example below, RtDwnHK was the name of the custom line end.  Macro recorder actually got it wrong.  Here's correct syntax:

ActiveWindow.Selection(1).CellsSRC(visSectionObject, visRowLine, visLineEndArrow).FormulaU = "USE(""RtDwnHk"")"


Thanks Wapper
I thought about making one version for line begin and another for line end (one just being drawn in the opposite direction NOT flipped) but since there was no way to specify which was the end and which was the beginning I thought that visio would just flip one. so much for bad assumptions. I didn't even think about using the macro editor to see what kind of code it came up with, should have.
But still having problems, even though I created two seperate shapes for the line ends visio is STILL flipping one around and using the centers of the shapes as origins even though then ends of the shapes I want connected are defined precisely in the center of the drawing page (8-1/4x5-1/2) during the definition.
Very frustrating. I will just try to convince my colleagues to use one of the built in line ends to represent a stowed wire.
what, me worry?

wapperdude

Not at my PC...

As far as the centering goes I think you ought to be able to control that with LocPinX and LocPinY settings in shapesheet for the custom end.  Haven't played with custom ends too much, so not positive about that.  Some links...
https://blogs.msmvps.com/visio/2005/06/05/custom-line-ends/

WRT saving/universally a available:  https://support.microsoft.com/en-us/office/add-a-new-fill-pattern-line-pattern-or-line-ends-pattern-bc636108-1fe1-4a24-8ec5-6b7de8b16dca  and
https://support.d-tools.com/01_SIX/User_Guide/04_Projects/03_Visio_Interface/Visio_Shapes_for_SIX/05_Wire_Shapes/Create_Graphic_Line_Ends

Obviously, the D-Tools is product specific, but the method could be universally applied...in keeping with with pre v pious link.
Visio 2019 Pro

perry59

Thanks Wapper
I'll play with the shapesheet cells and see if I get results.
I had seen the first two links, but not the third one which was helpful.
there was also mention of defining just ONE line end, and it would be at the end, flipped for the beginning. that might be a hallelujah moment!
what, me worry?