using System.Collections.Generic;
using Autodesk.Forge.DesignAutomation.Model;
namespace Interaction
{
///
/// Customizable part of Publisher class.
///
internal partial class Publisher
{
///
/// Constants.
///
private static class Constants
{
// Constants containing the name of the specific Inventor engines. Please note
// that potentially not all engines are listed - new egines may have been added meanwhile.
// Please use the interaction tools function - list all engines in order to find name of engine that is not listed here
private const string InventorEngine2021 = "Autodesk.Inventor+2021"; // Inventor 2021
private const string InventorEngine2022 = "Autodesk.Inventor+2022"; // Inventor 2022
private const string InventorEngine2023 = "Autodesk.Inventor+2023"; // Inventor 2023
private const string InventorEngine2024 = "Autodesk.Inventor+2024"; // Inventor 2024
private const string InventorEngine2025 = "Autodesk.Inventor+2025"; // Inventor 2025
public static readonly string Engine = InventorEngine2025;
public const string Description = "PUT DESCRIPTION HERE";
internal static class Bundle
{
public static readonly string Id = "MachinePlannerExport";
public const string Label = "alpha";
public static readonly AppBundle Definition = new AppBundle
{
Engine = Engine,
Id = Id,
Description = Description
};
}
internal static class Activity
{
public static readonly string Id = Bundle.Id;
public const string Label = Bundle.Label;
}
internal static class Parameters
{
public const string InventorDoc = nameof(InventorDoc);
public const string OutputIpt = nameof(OutputIpt);
}
}
///
/// Get command line for activity.
///
private static List GetActivityCommandLine()
{
return new List { $"$(engine.path)\\InventorCoreConsole.exe /al \"$(appbundles[{Constants.Activity.Id}].path)\" /i \"$(args[{Constants.Parameters.InventorDoc}].path)\"" };
}
///
/// Get activity parameters.
///
private static Dictionary GetActivityParams()
{
return new Dictionary
{
{
Constants.Parameters.InventorDoc,
new Parameter
{
Verb = Verb.Get,
Description = "IPT file to process"
}
},
{
Constants.Parameters.OutputIpt,
new Parameter
{
Verb = Verb.Put,
LocalName = "result.ipt",
Description = "Resulting IPT",
Ondemand = false,
Required = false
}
}
};
}
///
/// Get arguments for workitem.
///
private static Dictionary GetWorkItemArgs()
{
// TODO: update the URLs below with real values
return new Dictionary
{
{
Constants.Parameters.InventorDoc,
new XrefTreeArgument
{
LocalName = "document.ipt",
Url = "!!! CHANGE ME !!!"
}
},
{
Constants.Parameters.OutputIpt,
new XrefTreeArgument
{
LocalName = "document.ipt",
Verb = Verb.Put,
Url = "!!! CHANGE ME !!!"
}
}
};
}
}
}