Forum Discussion
Change the connecting point of an arrow head ?
- Nov 06, 2022
I had wondered whether to send you a copy of a program I wrote years ago (2014) to analyse diagrams and plot fragments of the graph dynamically. The problem is that it would take me a week to remember and get to grips with the techniques I used, so I am not sure how you would fare.
It uses Class modules for the Graph object itself and for the GraphNode and GraphEdge collections that comprise it. In your case, that might mean having a Class 'FamilyTree' with methods to Add people as instances of the Person class. Each oPerson ('o' for Object) might have properties such as '.Name', '.DOB' and relationships such as .Parent, .Partner, .EldestChild or .Sibling that have other objects from the Person Class as their values.
If that isn't bad enough, I also adopted someone else's central error checking code, so every module starts with standard set of module name identifiers and initialises the error variable to show an error unless the module subsequently reaches the 'success' setting.
It is odd how one's own past work can lie so far outside one's comfort zone!
It is a few years since I have controlled shapes using VBA. One of the tricks I remember using was to generate the diagram by hand and then limit the code to toggling the visibility of alternative shapes to create dynamic shape diagrams. Since I was drawing the shapes by hand, I needed to read the connection port numbers but not to change the linkage. Drawing with freeform connection objects was fun though.
- keldsorNov 05, 2022Brass ContributorIn the longer run I plan to automate it very much further - it's to be used in building a family tree
- PeterBartholomew1Nov 05, 2022Silver Contributor
That gets 'interesting' quite quickly. What is your data structure to hold the family tree? Assuming the diagram covers the entire tree, as opposed to navigating a restricted view, you have two persistent (still there after switching the application off and on again) representations of the tree (data and diagram). Which is the master? It is possible to require the diagram to update when you change the data held within linked tables or to change the data when you add elements to the diagram. Or you could accept both and use VBA Class modules (a transient representation) and events to synchronise the other whenever either representation is changed.
- keldsorNov 05, 2022Brass ContributorI have my genealogical research in an MS Access DB and this 'version minus 2' of the tree structure is just to get all the SUBs for showing persons, couples and their children to work right. I too have a lot of SUBs to move selected groups of shapes. All these SUBs are now controlled manually by buttens on the Quick Access Toolbar.
When I implement the 'automated version' - I think it will be better to control the Excel SUBs from inside Access controlled by an appropriate algorithm.
From what I already have done 'automatic generating' the tree from within Access into Excel, I think I'll just redraw the tree when needed.
In fact teh tree quickly becomes very unmanageable anyway due to the small screen in relation to the size of the tree.