Author Topic: Set angle of shape when glued  (Read 969 times)

0 Members and 1 Guest are viewing this topic.

iankoe

  • Jr. Member
  • **
  • Posts: 18
Set angle of shape when glued
« on: May 26, 2019, 08:27:00 AM »
In the UML Component stencil (latest version), there is a shape called "Provided Interface" which changes angle when connected to another shape.
When the shape is first dropped on the page the Shape_Transform.angle (in the shapesheet ) is just a number, but when connected to a shape called module, the angle changes to: =ANGLETOPAR(180 deg,Module!EventXFMod,EventXFMod)
and PinX and PinY also change.

How does it do that?  I want to copy that behavior into my shape, but cannot figure out how it works.

bmwk100dk

  • Jr. Member
  • **
  • Posts: 14
Re: Set angle of shape when glued
« Reply #1 on: May 27, 2019, 06:07:17 AM »
Hi iankoe
The changes happens automatically to the shape you are connecting, when you attach 2 shapes. If you want to change the angel of the shape you are connecting, you have to look at dir/x and dir/y cells in the shapesheet of the you are connecting, and also in the the shape you are connecting to. In the drawing I have attached, the actuator will turn 45° to the body, depending on wich corner of the middel square you choose to connect to. The 45° comes from the actuator, and the rest comes from the body shape.
I hope this will help you figure out how to make your shape turn the way you want.

bmwk100dk

iankoe

  • Jr. Member
  • **
  • Posts: 18
Re: Set angle of shape when glued
« Reply #2 on: June 01, 2019, 07:45:08 AM »
Thanks.  Yeah,  I was not very clear on my question.  On my shape I have a connection point with Type/C =1.  I want this shape top glue to the edge of another shape when I drag the shape so that my inward connection point aligns to the connection point on the edge of the other shape.

When I drag my shape off the stencil, it glues just fine to the other shape.  That is just what I want.  But once it is on the page, the gluing behavior stops.  Since the shapes dont glue, the orientation doesn't get set.

Just to be clear:  My shapes glue together and the orientation gets set correctly when I drag my shape off the stencil and place it over the connection point of my target shape.  But once it is on the page, the desired behavior stops.

Any ideas?

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3833
  • Ideas Visio-lized into solutions
Re: Set angle of shape when glued
« Reply #3 on: June 01, 2019, 10:07:27 AM »
Perhaps this helps...
When you grab a shape, Visio actually uses the "grab" location to select the connection point closest to the grab spot.  So, drag your shape and place it somewhere.  Then, re-grab close to the desired connection point and then drag to the glue point.  That ought to work.

Otherwise, up load a simple example.

Visio 2019 Pro

iankoe

  • Jr. Member
  • **
  • Posts: 18
Re: Set angle of shape when glued
« Reply #4 on: June 01, 2019, 02:30:45 PM »
It turns out that if I created a new Visio document and tried it again, it worked.  I have no idea why.  In the attached file: "Test", when I drag the "Provided Interface" shape onto the page and attach to to the module shape, it works, but does not work if I drag it onto the page first and then try to glue it top the module shape.

But in the file: Test2, it works both ways (as it should).  Any idea why?

(I dont think you need the original stencil as you can use the Document Stencil, but if you do, it can be found at: http://pbea.iankoenig.com/uml/pbea_architecture.vssx)