Message 1 of 8
Activator.CreateInstance() problem??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Dears.
I used the Activator.CreateInstance() to run autocad in my program.
It worked well in cad 2015, 2018, 2021.
However, a problem occurred after installing civil3d 2023.
try
{
dynamic acAppComObj = Activator.CreateInstance(Type.GetTypeFromProgID("AutoCAD.Application.24"));
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show($"Instance of 'AutoCAD.Application' could not be created.\r\nProgId : {sProgId} \r\n{ex.Message}");
return -1;
}
This code always run civil 3d.
I think the procid of 2023 is "AutoCAD.Application.24.2".
The results after running CAD 2021 are the same, civil3d 2023 launched.
How can I launch the Autocad 2021?