Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: asfadel on August 01, 2020, 07:02:10 PM

Title: Orientation of the sub-shapes to the dynamic connector
Post by: asfadel on August 01, 2020, 07:02:10 PM
Hello, dear members of the forum!
I would like to make a dynamic connector for myself with labels on both sides and counterparts for circuit shape blocks. The connector described here https://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html (https://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html) was taken as a basis (thanks to John Goldsmith !). Now I changed everything I wanted, but I just cannot correctly orient the mating parts (subshapes - rectangles on both sides of the dynamic connector) and fix their sizes. In the attachment example "test", there is a dynamic connectors: "now" - what I have, "need 1" - "need 3" - how I would like it to be like.
Help me, please, how to solve this problem?
Sorry for my English, I hope you can understand me.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: Surrogate on August 02, 2020, 09:20:22 AM
Cross-post via Google Translate (https://translate.googleusercontent.com/translate_c?depth=1&nv=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=http://visio.getbb.ru/viewtopic.php%3Ff%3D5%26t%3D1598&usg=ALkJrhiqNLoWBWGlowPzW4rc-WKW7el2iA) with some suggestions.

Quote from: asfadel on August 01, 2020, 07:02:10 PMSorry for my English, I hope you can understand me.
Don't worry, i am member of this forum about 10 years. I learn English in 1986-1992 in Moscow school and i was not good pupil  :)
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: wapperdude on August 03, 2020, 01:49:24 AM
What version of Visio are you using?  Since you provide a vsd file, it would seem you are using 2007 or older.  The link you provided  is based upon more recent Visio object model.  Some of the features used in the solution don't exist for older versions of Visio. 

It may be possible to put together something, but, it would take much more coding to work-around the lack of features...Hence my question.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: Surrogate on August 03, 2020, 03:51:04 AM
Visio 2010 also use vsd-file format! In article John Goldsmith (https://mvp.microsoft.com/en-us/PublicProfile/4020443?fullName=John%20%20Goldsmith) mentioned functions which was added in Visio 2010.
In Russian Visio forum I set preffered format:
(https://i.ibb.co/3RwhS5Q/Screenshot-2020-08-03-06-51-05-069-com-android-browser.png)
May be our topic starter use there vsd-format according this rule?
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: asfadel on August 03, 2020, 05:49:00 PM
Yes, quite right, it is Visio 2010 file format. All functions and features are working, except correct linking counterparts-rectangles to ends of dynamic connector. I tried to figure out how it works with labels, but nothing came of it.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: JohnGoldsmith on August 09, 2020, 02:49:27 PM
Hi,
Good to hear the connector is proving useful.  At the moment I'm not quite clear on what the problem is.  Can you describe what behaviour you would like to see and what is not happening?
Maybe remove all of the shapes and masters so that we can get the simplest demonstration of the problem.  Can you demostrate with two rectangles and a single connector? (+ a description of what's (not) happening).

Best regards
John
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: asfadel on August 09, 2020, 05:08:26 PM
Thanks for quick reply, John!
The problem is, I can't figure out how to fill the sections "PinX(Y) and LocPinX(Y)" of the subshape-rectangles (fixed size 17.5mm x 5mm) at both ends of the dynamic connector. Rectangles should automatically track their position relative to blocks 1 and 2, and begin (end) strictly at the end of the connecting line. In the attached file, the dynamic connectors "correct 1" - "correct 3" are examples of how it should be, and "incorrect 1" - "incorrect 2" are examples of how it works now. That is, for any orientation relative to blocks 1 and 2, these subshape-rectangles must be inside these blocks.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: wapperdude on August 09, 2020, 06:56:33 PM
@Surrogate:  I don't think forcing .vsd is good idea.  If nothing else, it signals that newer version of Visio is being used and, therefore, a more updated object model. 

A better idea is to have the enrollment procedure request version of Visio, and have that displayed with each post.  I think that's much cleaner and more informative.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: wapperdude on August 09, 2020, 06:59:46 PM
At JohnGoldsmith:  The other requirement, I believe, is for the rectangles to be hidden, based upon whichever end is not connected.  Perhaps the OP can clarify.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: asfadel on August 09, 2020, 08:08:30 PM
To hide the rectangles I use EndTrigger and BegTrigger of the dynamic connector.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: JohnGoldsmith on August 11, 2020, 09:32:04 AM
Thank you for the screenshot and further details - that's helpful in seeing what you're after.
A key part of this shape is deciding which side the label should be placed relative the the end point that its tracking.  This is done using the RECTSECT function which returns an integer ("0=zero (center), 1=right, 2=top, 3=left, 4=bottom").

Once you know where the label is placed your extra 'block' is going to want to sit in the opposite direction.  So I've added two new user cells in the group shape that translate the label postion:
User.Block_Start_Side = INDEX(User.Label_Start_Side,"0;3;4;1;2",";","0")User.Block_End_Side = INDEX(User.Label_End_Side,"0;3;4;1;2",";","0")
From there you can use those new values to calculate the LocPin postion (see image and file for details).
Best regards
John
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: JohnGoldsmith on August 11, 2020, 09:36:31 AM
I think I agree with you @wapperdude on file formats, particularly since the newer format allows you to see whether the file has code or not.
There's also the Visio Compatibility Pack (https://www.microsoft.com/en-gb/download/details.aspx?id=39640) for Visio 2010 to be able to open newer format file.
Anyway, I've attached the vsd in the previous post and I'll attach the same file in vsdx format to this one.
All the best
John
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: Surrogate on August 11, 2020, 10:35:57 AM
Hi, John !
Quote from: JohnGoldsmith on August 11, 2020, 09:36:31 AM
There's also the Visio Compatibility Pack (https://www.microsoft.com/en-gb/download/details.aspx?id=39640) for Visio 2010 to be able to open newer format file.
Sorry, just now this hyperlink dont work ! Also this converter didn't work with Visio 2007 and more ancient versions.
I started thread (https://www.translatetheweb.com/?ref=TVert&from=&to=en&a=https%3A%2F%2Fvisio.getbb.ru%2Fviewtopic.php%3Ff%3D15%26t%3D957) at our Russian Visio forum 4 years ago. This converter works not for all, sometimes we need use it with command line !

The suggest to attach only vsd files was added in 2013, when many users used incompatible versions with vsdx! This was also topical in 2016.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: JohnGoldsmith on August 11, 2020, 11:18:26 AM
Hmm, well it worked this morning but is clearly feeling unhappy now.....maybe it will come back later on.
Well I hear what you're saying and I wouldn't want to intentionally exclude anyone who's not able to be on the latest version - I'm just saying that in 2020 maybe the default should be vsdx and if a user only has access to vsd then by all means post that file instead.
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: JohnGoldsmith on August 11, 2020, 11:21:40 AM
Sorry - forgot to add the screenshot of the connector...
Title: Re: Orientation of the sub-shapes to the dynamic connector
Post by: asfadel on August 11, 2020, 05:37:32 PM
Thanks a lot, John! This is what I need. I'll try to figure it out.