Orientation of the sub-shapes to the dynamic connector

Started by asfadel, August 01, 2020, 07:02:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

asfadel

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

Surrogate

#1
Cross-post via Google Translate 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  :)

wapperdude

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.
Visio 2019 Pro

Surrogate

#3
Visio 2010 also use vsd-file format! In article John Goldsmith mentioned functions which was added in Visio 2010.
In Russian Visio forum I set preffered format:

May be our topic starter use there vsd-format according this rule?

asfadel

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.

JohnGoldsmith

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
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

asfadel

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.

wapperdude

@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.
Visio 2019 Pro

wapperdude

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.
Visio 2019 Pro

asfadel

To hide the rectangles I use EndTrigger and BegTrigger of the dynamic connector.

JohnGoldsmith

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
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

JohnGoldsmith

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 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
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

Surrogate

Hi, John !
Quote from: JohnGoldsmith on August 11, 2020, 09:36:31 AM
There's also the Visio Compatibility Pack 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 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.

JohnGoldsmith

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.
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

JohnGoldsmith

Sorry - forgot to add the screenshot of the connector...
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/