Community
Hi how can convert
This code is from @Jeff_M
From Lisp to C-Sharp
https://forums.autodesk.com/t5/civil-3d-customization/create-cogo-point-using-lisp/td-p/8960247
(setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
(if vlax-user-product-key
(vlax-user-product-key)
(vlax-product-key)
)
)
C3D (vl-registry-read C3D "Release")
C3D (substr
C3D
1
(vl-string-search
"."
C3D
(+ (vl-string-search "." C3D) 1)
)
))
to get the number for example "13.4"
I came close to it, I did not know the origin of the solution
https://www.theswamp.org/index.php?topic=43276.0
// I got the "Software\Autodesk\AutoCAD\R19.0\ACAD-B001:409" value:
String _x = AcDb.HostApplicationServices.Current.MachineRegistryProductRootKey;
// I got the "Software\Autodesk\AutoCAD\R19.0\ACAD-B001:409" value:
String _y = AcDb.HostApplicationServices.Current.UserRegistryProductRootKey;
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
/// <summary>
/// module must be "Land", "Pipe", "Roadway", or "Survey"
/// </summary>
/// <param name="module"></param>
/// <returns>AeccApp string</returns>
public static dynamic GetAeccApp(string module)
{
var rootkey = HostApplicationServices.Current.UserRegistryProductRootKey;
var hj = Registry.LocalMachine.OpenSubKey(rootkey);
var c3d = (string)hj.GetValue("Release");
c3d = c3d.Substring(0, c3d.IndexOf(".", (c3d.IndexOf(".") + 1)));
hj.Close();
c3d = "AeccXUi" + module + ".Aecc" + (module == "Land" ? "" : module) + "Application." + c3d;
dynamic acadApp = Application.AcadApplication;
dynamic aeccApp = acadApp.GetInterfaceObject(c3d);
return aeccApp;
}
Can't find what you're looking for? Ask the community or share your knowledge.