Changing geometry programmatically

Started by thedaoka, August 04, 2008, 08:15:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thedaoka

Hi All,

I'm trying copy the geometry section from a dynamic connector (1D shape) into a new drawing programmatically.
The problem is that sometimes Visio descides to remove rows from the geometry section while I'm filling in the x and y coordinates. Has anybody got an idea how I can prevent Visio from doing this ?

Best regards,
TheDaoka

Paul Herber

As an initial thing to try set the LockCalcWH flag in the Protection section to true.


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

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

thedaoka

I already tried that but didn't help.

Paul Herber

Ah yes, with dynamic connectors the gluepoints and routing style will take preference over your own edits. Check that both pages have the same routing style set. An example of the routing etc taking preference - create an Org chart with an executive and a manager, now try to edit the connector using the shapesheet, you can't add rows to the geometry.


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

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

thedaoka

The routing style are the same in both pages.

It strage that programatically it's not possible to add rows while manually it is possible when moving the geometrical points.

Apparently the problem occurs when two geometrical points are moved very closely together (less than 1 mm), then visio automatically removes that point.

However when you glue a 2d shape to one of the connectionpoints and then move the 2d shape so that the geometrical points move very closely together, then visio doesn't remove it.

thedaoka

I found out why geometric points are removed when less than 2,5 mm from each other.
On the page properties section in the shapesheet there is an option LineToLineX and LineToLineY (visPLOLineToLineX and visPLOLineToLineX in code) which is default set at 2,5 mm. Changing this to 0 will change this behaviour.

Why it's not possible to add rows to the geometry section I don't know yet.

Visio Guy

The Dynamic connector is...well...dynamic, so anything you do to the Geometry1 section inside of the connector runs the risk of being stomped by Visio's connector routing code. I wouldn't depend on anything I've done to Geometry1 of a dynamic connector being around for very long.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010