.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How determine running Applicatio n is Civil or "Civil run as AutoCAD"?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
i can determine the installed Version with:
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLink
but this key is also by running Civil as AutoCAD.
How i can determine between "Civil" and "Civil runing as AutoCAD" ?
regards Mario
Solved! Go to Solution.
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD&qu o
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
try to connect to any AECC-based lib, if you get an error it's the wrong profile for useing any Civil-API
Quick&dirty to check the availability of Civil-API:
Dim tCivilAPI_active as Boolean = false Try
Dim tActiveX_ProgID as String = "AeccXUiLand.AeccApplication.9.0" 'use your version-nr Dim tObj As Object = pAcadAppCOM.GetInterfaceObject(tActiveX_ProgID) tCivilAPI_active = (tObj IsNot Nothing) 'TODO release the COM-object here Catch ex As Exception tCivilAPI_active = false 'just to make sure End Try
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD&am p
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi alfred,
;-( ... dont work for me.
pAcadAppCOM.GetInterfaceObject("AeccXUiLand.AeccAp
even with the official start parameters Civil3D as AutoCAD "/ P AutoCAD"
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD&am p
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello,
i have found a solution that works fine.
If someone has a diferent version he can post so times.
regards Mario
public static Boolean isCivilRunning()
{
Boolean result = false;
try
{
foreach (System.Reflection.Assembly item in AppDomain.CurrentDomain.GetAssemblies())
{
if (item.FullName.StartsWith("AeccUiWindows"))
{
result = true;
break;
}
}
}
catch
{
// return false;
}
return result;
}
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD&am p
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
@Mario,
First of all, thanks... but, this is not reliable for me
.
I don't know CIVIL but I suppose it is exactly like MECHANICAL.
What you can try is :
- Start AutoCAD, in <<VANILLA>> profile.
- Change the profile to your <<CIVIL>> one.
- Your code will say: "Civil is running"
, but If you try manually to use a CIVIL command, you will get something like "unknown command"
.
You know, when you develop an application that has to be deployed on thousands of computers and used daily by many users all over the world, you must be prepared to evrything ![]()
@Alfred
As I said previously, even with a "Try... Catch", you can sometimes get a fatal error on the GetInterfaceObject.
That's why we are looking to be sure, BEFORE, to be in the correct release.
Regards,
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
We use a loader dll to check the "IsPureAcadProfile" profile in use when Civil3D starts. If it is 1 then we inform the user that our dll will not be loaded. If it is 0 then we load our dll.
Re: How determine running Applicatio n is Civil or "Civil run as AutoCAD&am p
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
