Author Topic: Getting autocad vertical information  (Read 1497 times)

0 Members and 1 Guest are viewing this topic.

sdunn

  • Newt
  • Posts: 90
Getting autocad vertical information
« on: January 20, 2016, 06:43:57 PM »
I am looking for an automated way in .net to obtain the service pack version of Civil 3D 2013 and newer.

I found where I can get the application version but not the service pack information.  Am I limited to searching the registry?

sdunn

  • Newt
  • Posts: 90
Re: Getting autocad vertical information
« Reply #1 on: January 25, 2016, 07:29:45 PM »
Thanks to Jeff for this:
http://forums.autodesk.com/t5/autocad-civil-3d-customization/find-the-current-service-pack-version-of-civil-3d/td-p/6000264

I came up with something in lisp that works for 2015.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:getinfo ()
  2. (cond ((setq wscript (vlax-create-object "WScript.Network"))
  3.        (setq pcname (vlax-get-property wscript "ComputerName")
  4.              pcdom  (vlax-get-property wscript "UserDomain")
  5.              pcuser (vlax-get-property wscript "UserName")
  6.        )
  7.        (vlax-release-object wscript)
  8.       )
  9. ); cond
  10.  
  11. ; get civil 3d service pack info from registry
  12. (setq reg (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)))
  13. (setq reg (strcat (substr reg 1) "\\Service Packs"))
  14. (setq reg (strcat reg "\\" (car (vl-registry-descendents reg))))
  15. (setq PatchTitle (vl-registry-read reg "PatchTitle"))
  16. (setq Release (vl-registry-read reg "Release"))
  17. ; Get ram using doslib
  18. (setq maj (itoa (atoi (getvar "acadver"))))
  19. (setq dls (strcat "doslib" maj ".arx"))
  20. (setq res (dos_mem))
  21. (setq mem (rtos (nth 1 res) 2 0))
  22. (setq memgb (/ (read mem) 1048576))
  23.  
  24.         (list "\nComputername: "  pcname
  25.                 "\nUser domain:  "  pcdom
  26.                 "\nUser name:    "  pcuser
  27.                 "\nService Pack: " PatchTitle
  28.                 "\nRelease: " Release
  29.                 "\nTotal Physical Memory: " memgb
  30.     )
  31. )
  32. )


huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Getting autocad vertical information
« Reply #2 on: January 26, 2016, 03:33:09 AM »
Gile wrote an excellent function to find information about installed versions:

http://www.theswamp.org/index.php?topic=31867.msg538136#msg538136

Maybe that will help you.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.