Autodesk ObjectARX
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
220 Views, 6 Replies
09-06-2006 07:13 AM
Hi all,
is there a possibility to determine what type of AutoCAD is running? Standard AutoCAD or Map3D or Civil3D or whatever? I already drag the version info from the currently running acad.exe file, but there is to information about the AutoCAD type saved in the version info. I could parse the path, but that's not a solution for me since everyone can change the pathname to whatever he likes.
Any ideas?
Thanks in advance!
Cheers, Hannes
is there a possibility to determine what type of AutoCAD is running? Standard AutoCAD or Map3D or Civil3D or whatever? I already drag the version info from the currently running acad.exe file, but there is to information about the AutoCAD type saved in the version info. I could parse the path, but that's not a solution for me since everyone can change the pathname to whatever he likes.
Any ideas?
Thanks in advance!
Cheers, Hannes
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-06-2006 08:58 AM in reply to:
schneider
Hannes,
Its in the registry:
HKLM\Software\Autodesk\R**.*\ACAD-****:***\Product Name
Its in the registry:
HKLM\Software\Autodesk\R**.*\ACAD-****:***\Product
*Deelip Menezes
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-06-2006 09:15 AM in reply to:
schneider
How about the AutoCAD _VERNUM variable?
Deelip Menezes
wrote in message news:5319201@discussion.autodesk.com...
Hi all,
is there a possibility to determine what type of AutoCAD is running?
Standard AutoCAD or Map3D or Civil3D or whatever? I already drag the version
info from the currently running acad.exe file, but there is to information
about the AutoCAD type saved in the version info. I could parse the path,
but that's not a solution for me since everyone can change the pathname to
whatever he likes.
Any ideas?
Thanks in advance!
Cheers, Hannes
Deelip Menezes
Hi all,
is there a possibility to determine what type of AutoCAD is running?
Standard AutoCAD or Map3D or Civil3D or whatever? I already drag the version
info from the currently running acad.exe file, but there is to information
about the AutoCAD type saved in the version info. I could parse the path,
but that's not a solution for me since everyone can change the pathname to
whatever he likes.
Any ideas?
Thanks in advance!
Cheers, Hannes
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-06-2006 09:54 AM in reply to:
schneider
It's code maybe useful for you:
[code]
static public void AInfo()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Edit or;
string AcadVer = Autodesk.AutoCAD.ApplicationServices.Application.V ersion.ToString();
ed.WriteMessage("\nAcadVersion: {0}", AcadVer);
string ProductKey = Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLink er.ProductKey;
ed.WriteMessage("\nProductKey: {0}", ProductKey);
RegistryKey key = Registry.LocalMachine.OpenSubKey(ProductKey);
string ProductName = key.GetValue("ProductName").ToString();
ed.WriteMessage("\nProductName: {0}", ProductName);
string ProductId = key.GetValue("ProductId").ToString();
ed.WriteMessage("\nProductId: {0}", ProductId);
string ProductCode = key.GetValue("ProductCode").ToString();
ed.WriteMessage("\nProductCode: {0}", ProductCode);
}
[/code]
In ObjectARX you can use:
AcDbHostApplicationServices::getRegistryProductRoo tKey()
AcDbHostApplicationServices:
roduct()
and so on. Message was edited by: Alexander Rivilis
[code]
static public void AInfo()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Edit
string AcadVer = Autodesk.AutoCAD.ApplicationServices.Application.V
ed.WriteMessage("\nAcadVersion: {0}", AcadVer);
string ProductKey = Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLink
ed.WriteMessage("\nProductKey: {0}", ProductKey);
RegistryKey key = Registry.LocalMachine.OpenSubKey(ProductKey);
string ProductName = key.GetValue("ProductName").ToString();
ed.WriteMessage("\nProductName: {0}", ProductName);
string ProductId = key.GetValue("ProductId").ToString();
ed.WriteMessage("\nProductId: {0}", ProductId);
string ProductCode = key.GetValue("ProductCode").ToString();
ed.WriteMessage("\nProductCode: {0}", ProductCode);
}
[/code]
In ObjectARX you can use:
AcDbHostApplicationServices::getRegistryProductRoo
AcDbHostApplicationServices:
and so on. Message was edited by: Alexander Rivilis
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-07-2006 01:56 AM in reply to:
schneider
Thanks for all replies. I've found a way to definitely distinguish between different AutoCAD releases and versions. For those also facing this problem, here is the way to go:
CString regRootKey = acdbHostApplicationServices()->getRegistryProductR ootKey();
CRegistry reg;
reg.Open(HKEY_LOCAL_MACHINE, regRootKey, KEY_READ);
TCHAR buf[200];
ULONG bufSize = 200;
reg.QueryStringValue(_T("ProductName"), buf, &bufSize);
reg.Close();
Now buf is "AutoCAD 200x" for standard AutoCAD-Releases, "Autodesk Map 3D 200x" for Map3D, "Autodesk Civil 3D 200x" for Civil3D and so on.
Thanks everyone for pointing me to the right direction.
Cheers, Hannes.
CString regRootKey = acdbHostApplicationServices()->getRegistryProductR
CRegistry reg;
reg.Open(HKEY_LOCAL_MACHINE, regRootKey, KEY_READ);
TCHAR buf[200];
ULONG bufSize = 200;
reg.QueryStringValue(_T("ProductName"), buf, &bufSize);
reg.Close();
Now buf is "AutoCAD 200x" for standard AutoCAD-Releases, "Autodesk Map 3D 200x" for Map3D, "Autodesk Civil 3D 200x" for Civil3D and so on.
Thanks everyone for pointing me to the right direction.
Cheers, Hannes.
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-13-2012 05:43 AM in reply to:
schneider
What is this: CRegistry ??
error C2065: 'CRegistry' : undeclared identifier
Re: Determine AutoCAD Type
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-15-2012 07:48 AM in reply to:
ZK_BUDiKOM
ZK_BUDiKOM wrote:
What is this: CRegistry ??
error C2065: 'CRegistry' : undeclared identifier
Registry Wrapper Class (CRegistry)



