Community
I am trying
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.IsModuleLoaded("Test.arx");
to determine if Test.ARX is loaded, but it keeps returning false. I know for a fact that Test.ARX is loaded. Maybe this function is not the right one to use. Is there another function to find out if a particular ARX is loaded? Thanks for your help.
What happens if you include the path?
try
{
if (!SystemObjects.DynamicLinker.IsModuleLoaded (Path.Combine("YourPath", "Test.arx")))
{
SystemObjects.DynamicLinker.LoadModule(Path.Combine("YourPath", "Test.arx"), false, true);
}
}
catch (Exception ex)
{
// ...
}
try this:
...
var amAcad = loadedAssemblies.Keys.Where(n => n.StartsWith("AMACAD", StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
...
//Returns both *.dll and *.arx
public static Dictionary<string,Assembly> GetLoadedAssemblies()
{
var assemblies = new Dictionary<string, Assembly>(StringComparer.OrdinalIgnoreCase);
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
var assyName = assembly.GetName().Name;
assemblies[assyName] = assembly;
}
return assemblies;
}
Seems like this can find all the managed assemblies. It does not list any arx files.
This is my output, definitely showing a arx files in the list:
You could also find arx modules querying the Current Process, like so:
var modules = Process.GetCurrentProcess().Modules.OfType<ProcessModule>()
.Where(x => x.FileName.EndsWith(".arx", StringComparison.CurrentCultureIgnoreCase))
.ToList();
Can't find what you're looking for? Ask the community or share your knowledge.