Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

convert code From Lisp to C-Sharp

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
hosneyalaa
356 Views, 2 Replies

convert code From Lisp to C-Sharp

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;
 

 

 

 

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: hosneyalaa

        /// <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;
        }
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
hosneyalaa
in reply to: Jeff_M

@Jeff_M 

Thanks a lot

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report