Author Topic: How can I find the AutoCAD's installation path  (Read 3283 times)

0 Members and 1 Guest are viewing this topic.

iliekater

  • Guest
How can I find the AutoCAD's installation path
« on: December 07, 2006, 08:07:27 AM »
How is it possible to find the AutoCAD's installation path by using VBA ? I would be happy if you also tell how could I do that with LISP as well !
Up to now I have used the CurDir function , but although some times it returns the AutoCAD's installation path , some others it returns the My Documents folder ! ... The truth is that I don't really understand what the current directory represents ... Anyway , I would like to know how can I get that path (and especially by VBA) .

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How can I find the AutoCAD's installation path
« Reply #1 on: December 07, 2006, 08:13:24 AM »
Do you want the ACAD.exe address or the Support File Search Path  from options->Files

Are you familiar with the ActiveX Object Model ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How can I find the AutoCAD's installation path
« Reply #2 on: December 07, 2006, 08:26:04 AM »


Take your pick

ThisDrawing.Application.preferences.Files

ThisDrawing.Application.FullName


(getenv "ACAD")


(findfile "acad.exe")


Welcome to theSwamp  iliekater  :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

iliekater

  • Guest
Re: How can I find the AutoCAD's installation path
« Reply #3 on: December 07, 2006, 02:35:52 PM »
  Oh boy , oh boy ! This is more help than I could ever imagine ! And thanks for your wellcoming !
  You see , I reached this forum thanks to Keith Blackie , whose I accidently saw his name on the web . I was a CADalog forum user back in the past and met there many people , like Keith Blackie , Daron , t-bear and many others , and I wish I see them here too . It's been many yaers since I was ocupied with writting codes for AutoCAD , but now I decided to make true a dream of mine from those days . You see , back then I created a large architectural program and wanted to make avaiable as much as possible of it to the public . The time past by and I had to carry about other things , but now I hope I will make it . Its name is going to be FreeCAD and is going to be avaible in both languages (Greek and English) .
  At the same time , I hope I will make myshelf useful to other people here on this forum . Thanks again for your help . I am off to post another topic about using Access with AutoCAD !

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How can I find the AutoCAD's installation path
« Reply #4 on: December 08, 2006, 01:05:42 AM »
I'm happy for you.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: How can I find the AutoCAD's installation path
« Reply #5 on: December 08, 2006, 07:59:01 AM »
How is it possible to find the AutoCAD's installation path by using VBA ? I would be happy if you also tell how could I do that with LISP as well !

Lisp
Code: [Select]
(vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key)) "ACADLOCATION")

VBA
Code: [Select]
ThisDrawing.Application.Path





iliekater

  • Guest
Re: How can I find the AutoCAD's installation path
« Reply #6 on: December 08, 2006, 03:21:12 PM »
  Thanks , rkmcswain . Without trying to underestimate your answer , I already found that . You see , since Kerry Brown told me about the Application object , I searched its properties and found the Path property .
  However , since you mentioned it , let me ask something else :
  Lets say that there wasn't any Path property and there was only the FullName property . How could one exctract the path string from FullName ? I quess using functions like Right etc , however , I still cant get it ...