[SOLVED]Print Dependency Graph?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

[SOLVED]Print Dependency Graph?

Post by ppemawm »

Does anyone know how to print a large dependency graph from a FreeCAD file? I searched the forum but to no avail.

Or, can it be reduced so that the whole graph can be viewed in the document window and then screen capture could be used?

I am using Windows 7 V0.13 Rev 1828
Last edited by ppemawm on Tue Sep 24, 2013 7:39 pm, edited 1 time in total.
"It is a poor workman who blames his tools..." ;)
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Print Dependency Graph?

Post by bejant »

Yes, I too would like to know if it is possible to zoom in and out in the dependency graph window...
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Print Dependency Graph?

Post by wmayer »

Neither printing nor zooming is possible. But you can enter this into the Python console

Code: Select all

App.ActiveDocument.DependencyGraph
and copy it to a file. Now run in the graphviz utility and specify a path for the PNG output file.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Print Dependency Graph?

Post by ppemawm »

wmayer wrote:Code: Select all
App.ActiveDocument.DependencyGraph
and copy it to a file. Now run in the graphviz utility and specify a path for the PNG output file.
OK, so I am not too familiar with Python or Graphviz. But, I did try to follow the following steps:

1. Inserted App.ActiveDocument.DependencyGraph into the Python console and executed the command which gave me a long string of characters between quotes
2. Copied the text between the '...' and opened GVEdit for GraphViz 1.01
3. Pasted the text into a new GVEdit file and selected 'Layout'
4. Which gave me many syntax errors in the Output Console that seems to say that the text is not in the format for GVEdit.

Is this the correct approach?
Any suggestions? A little more guidance would be helpful.
"It is a poor workman who blames his tools..." ;)
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Print Dependency Graph?

Post by wmayer »

Ah, it shows all the escape sequences. Then try this:

Code: Select all

 print App.ActiveDocument.DependencyGraph
The graphviz executable can be started from command line and you can paste the copied text into the terminal. You have to check the parameters of graphviz how to create an image and in which format.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Print Dependency Graph?

Post by ppemawm »

wmayer wrote:Ah, it shows all the escape sequences. Then try this:
Code: Select all
print App.ActiveDocument.DependencyGraph
This works quite well:

1. Insert Print App.ActiveDocument.DependencyGraph into the Python console and execute the command
2. Copy all the text provided after the command including the last bracket }
3. Open GVEdit for GraphViz 1.01
3. Paste the text into a new GVEdit file and select GRAPH/Layout which will generate the dependency graph in the View window
4. Select 'View' / Fit to Window to view the whole graph

Thanks for all the help.
"It is a poor workman who blames his tools..." ;)
Post Reply