[solved] Export 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!
User avatar
wandererfan
Posts: 3874
Joined: Tue Nov 06, 2012 5:42 pm

[solved] Export Dependency Graph?

Postby wandererfan » Tue Aug 22, 2017 4:36 pm

Is there a way to export the Dependency Graph in a form that is suitable for "marking up"? (highlighting sections, adding comments, etc).

I use screen grabs now, but they can be quite blurry on big graphs.

Thanks,
wf
Last edited by jmaustpc on Wed Aug 23, 2017 4:20 am, edited 1 time in total.
Reason: added "[Solved]" to the title
wmayer
Site Admin
Posts: 15747
Joined: Thu Feb 19, 2009 10:32 am

Re: Export Dependency Graph?

Postby wmayer » Tue Aug 22, 2017 5:18 pm

From Python you can export the dependency graph in text form with:

Code: Select all

App.ActiveDocument.exportGraphviz()
From C++ you can do it using the method exportGraphviz of App::Document. As argument it expects an output stream which can be a string stream or a file stream for example.
User avatar
Willem
Posts: 1335
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Export Dependency Graph?

Postby Willem » Tue Aug 22, 2017 5:53 pm

Hi,

when you do <CTR>S or select save on the pull down menu the dependency graph is saved as a PNG file of a good quality.
With GIMP I make remarks on it
User avatar
wandererfan
Posts: 3874
Joined: Tue Nov 06, 2012 5:42 pm

Re: Export Dependency Graph?

Postby wandererfan » Wed Aug 23, 2017 1:34 am

File>Save is great!
testCase1.png
testCase1.png (92.2 KiB) Viewed 476 times
Not sure what to do with the text version yet, but good to know about.

Code: Select all

>>> App.ActiveDocument.exportGraphviz()
'digraph "" {\n
graph [\ncompound=true];\n
subgraph clusterPart {\ngraph [\n
bgcolor="#53906750", label="Part&#92;n(thing through hoop)", style="rounded,filled"];\n
subgraph clusterBody {\n
graph [\n
bgcolor="#124f9a50", label="Body&#92;n(hoop)", style="rounded,filled"];\n
subgraph clusterOrigin001 {\n
graph [\n
bgcolor=none, label=Origin001];\n
Thank you,
wf
User avatar
wandererfan
Posts: 3874
Joined: Tue Nov 06, 2012 5:42 pm

Re: Export Dependency Graph?

Postby wandererfan » Wed Aug 23, 2017 1:39 am

Std_DependencyGraph :oops:
Just choose File → Save As to save the graph as a picture (PNG/BMP/GIF/JPG), a vector graphic (SVG) or as a pdf-file (PDF).
User avatar
bejant
Posts: 6076
Joined: Thu Jul 11, 2013 3:06 pm

Re: [solved] Export Dependency Graph?

Postby bejant » Wed Aug 23, 2017 5:11 am

wandererfan wrote:
Wed Aug 23, 2017 1:39 am
Std_DependencyGraph :oops:
Hi wf, I saved a piece of history for you:
https://forum.freecadweb.org/viewtopic. ... 56#p187756

P.S.: thank you for all the work you're doing on Tech Draw!