Not applicable
02-24-2017
08:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The first time that the Job.Info object is accessed it takes 20 seconds to continue to the next line.
oDR.InfoCreationDate = Job.Info.CreationDate;
// Command.cs...
namespace McKenneys
{
public class DuctDataExport : IExtensionApplication
{
public void Initialize()
{
//string sFile = @"Autodesk\Fabrication 2017\CADmep\FabricationAPI.dll";
//string sPF = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), sFile);
//Assembly MyDALL = Assembly.LoadFrom(sPF);
//Type MyLoadClass = MyDALL.GetType("Autodesk.Fabrication.Job"); // name of your class
//Activator.CreateInstance(MyLoadClass);
}
[CommandMethod("FabAPIDuctDataExport", "FabAPIDuctDataExport", CommandFlags.Modal)]
public void Execute()
{
try
{
string sFile = @"Autodesk\Fabrication 2017\CADmep\FabricationAPI.dll";
string sPF = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), sFile);
Assembly MyDALL = Assembly.LoadFrom(sPF);
Type MyLoadClass = MyDALL.GetType("Autodesk.Fabrication.Job");
Activator.CreateInstance(MyLoadClass);
ClassStatic.SetApplicationProperties();
ClassStatic.PopulateDataTables();
new ClassFabrication();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public void Terminate()
{
}
}
}
// ClassFabrication.cs...
namespace McKenneys.Classes
{
public class ClassFabrication
{
// Constructor...
public ClassFabrication()
{
...
Data1UpdateProject();
...
}
private void Data1UpdateProject()
{
// Create new strongly-typed DataRow object.
var oDR = ClassStatic.ProjectJobInformationDT.NewProjectJobInformationRow();
oDR.ProjectId = _ProjectId;
oDR.InfoCreationDate = Job.Info.CreationDate;
oDR.InfoDescription = Job.Info.Description;
...
}
}
}
As you can see I've tried Assembly.Load from two different methods.
What do I need to do to resolve this?
Thanks,
Randy
Solved! Go to Solution.