Importing of GEDCOM files requires the family tree shapes library to be loaded first. It is located in the following subfolder in the installation folder of NOV:
- Resources\ShapeLibraries\Family Tree\Family Tree Shapes.nlb
It is best to load the file format library using the GEDCOM file format's helper method in the entry point of the application. Thus you will have to load it only once, for example in the entry point of the application or right before creating the first family tree diagram.
Like most file operations in NOV, loading of the family tree library from file is an asynchronous operation, so the Then method of the returned promise should be used to get notified when the family tree library has been loaded.
The code below demonstrates how to load the family tree library:
Load the family tree shapes library |
Copy Code
|
---|---|
// Load the GEDCOM file format's family tree library (this needs to be done only once) NFile libraryFile = NApplication.ResourcesFolder.GetFile(NPath.Current.Combine( "ShapeLibraries", "Family Tree", "Family Tree Shapes.nlb")); NDrawingFormat.Gedcom.LoadFamilyTreeLibraryFromFileAsync(libraryFile).Then( delegate (NUndefined ud) { // Family tree library loaded successfully, so create the family tree diagram CreateFamilyTree(drawingView.ActivePage); }, delegate (Exception ex) { // Failed to load the family tree library } ); |