How to import from an XPZ file

Unofficial Content

Edit your .cs file and add the following using statements:

using Artech.Architecture.Common.Objects;
using Artech.Architecture.Common.Services;
using Artech.Architecture.BL.Framework.Services;
using Artech.Architecture.UI.Framework.Services;

Then use the following code to import from an XPZ file:

IOutputService output = CommonServices.Output;
// "pathDelXpz" defines the path of the .xpz to be imported
string pathDelXpz = "......";
// Define the options for the import as defaults
ImportOptions iOpts = ImportOptions.Default;
// Import the .xpz to the current model using iOpt as options for the import
if (BLServices.KnowledgeManager.ImportFile(pathDelXpz, UIServices.KB.CurrentModel, iOpts))
	// Success
	// Import falied
	output.Show("Import Failed");