Results 1 to 7 of 7

Thread: Possible to program macros without AutoCAD installed?

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2012-06
    Posts
    1
    Login to Give a bone
    0

    Default Possible to program macros without AutoCAD installed?

    Hi! I am trying to help someone whose AutoCAD Architect VBA macro quit working after upgrading from a 32-bit system (AutoCAD 2010, Office 2010) to a Windows 7 64-bit system (AutoCAD 2012 64-bit with AutoCAD 2010 also installed, Office 2010 64-bit). The macro is used to populate an Excel spreadsheet with square footage by department. They need to be able to run the macro on AutoCAD 2010 (32-bit or 64-bit) since it is the version that they use to edit space tags. (Was this feature lost in 2012?) I am a .NET programmer, I do not have AutoCAD installed. The only download available for a 30-day trial from Autodesk is AutoCAD 2013 - which has file differences from 2010-2012 according to what I have read. Is there any way I can work on "fixing" this macro without having AutoCAD installed? Is there an SDK that would give me the ability to compile and debug (intelli-sense would be nice too)? Am I being naive to think I can re-create the macro using the code from a .txt file? Any thoughts or suggestions would be greatly appreciated!

  2. #2
    I could stop if I wanted to hugh.69031's Avatar
    Join Date
    2016-01
    Location
    Melbourne, Australia
    Posts
    360
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    Short answer is no, with few exceptions you must have the right version of AutoCAD available to allow a VBA macro to run. VBA is being phased out in favour of a .NET based API so is no longer being installed by default (it can still be downloaded and installed from http://usa.autodesk.com/adsk/servlet...linkID=9240618).

    I suggest you download and install ACAD 2013 and the relevant VBA module from the above link to investigate the problem in ACAD 2013's VBE and get it going in a 64bit environment. So long as the VBA code does not reference anything in the object model that does not exist in 2010 or 2012 you should be able to port the result to the earlier environment then change the referenced libraries using VBE's Tools>References.

    OTOH if you can gain access to the system in question you could investigate the problem at first hand. It may be the problem could be fixed by just adjusting the referenced libraries.
    Last edited by hugh.69031; 2012-06-15 at 02:03 AM.

  3. #3
    Woo! Hoo! my 1st post
    Join Date
    2012-02
    Posts
    1
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    Thanks! I am now working on getting a 64-bit system up and running. It may be easier than dusting an old laptop and firing up VB6.

    I did spend a bit of time investigating first hand. We tried removing and adding back the "MISSING" references but the changes would not "stick" - we were unable to compile because the menu option was disabled (even after clicking the "reset"/stop button to stop the macro after getting the infamous "Can't find project or file" error message). I think it may be due to the macro being originally compiled in the 32-bit environment but now he is trying to run it in a 64-bit environment without making any changes to the code. I guess my short-term goal will be to make the necessary changes to get the VBA to compile in 64-bit so we can get the data required by the end of the fiscal year (in two weeks); then I can try to rewrite in .NET for future compatibility.

    - smith101 (previously pearson850594)

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    With vba, some stuff happens automatically. When the project loads, the compiler tries to bind it to the instance of AutoCAD currently running. Then the code compiles against that tlb. This is why you don't have to declare the variables AcadApplication and ThisDrawing. So the reference you checked is still "MISSING" if you checked something other than the current version of acad that you were testing with. IOW, you can't "fix" it on one version of acad and then expect it to run on another version. The Compile menu option was disabled because it already compiled. It only becomes enabled when you make code changes and they have not compiled yet. If you hit Run/F5, it compiles automatically.
    C:> ED WORKING....


    LinkedIn

  5. #5
    I could stop if I wanted to hugh.69031's Avatar
    Join Date
    2016-01
    Location
    Melbourne, Australia
    Posts
    360
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    Good thing that Ed has a better grasp of the fundamentals.

    Seems all you need do is make a trivial change in the VBA to enable the Compile menu option on the original system and click on it to find the next problem.
    Just addng a blank to the VBE code editor did the trick here. Compiling disables the meunu item until the next alteration. Worth a try.

  6. #6
    Active Member
    Join Date
    2009-08
    Posts
    93
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    They might make the jump with VBA7
    http://msdn.microsoft.com/en-us/library/ee691831.aspx

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Possible to program macros without AutoCAD installed?

    I don't think vba is going away anytime soon. Even MS hasn't gotten rid of it in Office. I was reading the editorial in the June issue of MSDN and there is a huge user base still using VB6, because as the article pointed out, "rewriting functional code nonrecreationally just doesn't pencil out".
    C:> ED WORKING....


    LinkedIn

Similar Threads

  1. 2014: AutoCAD VBA is not currently installed
    By 2Pospisil in forum AutoCAD General
    Replies: 0
    Last Post: 2013-06-03, 07:36 AM
  2. Replies: 0
    Last Post: 2012-04-17, 10:04 PM
  3. Are multiple program macros possible?
    By Liamnacuac in forum Software
    Replies: 1
    Last Post: 2009-09-25, 05:45 PM
  4. AutoCAD... not installed properly
    By AutoTAD in forum AutoCAD General
    Replies: 5
    Last Post: 2009-01-06, 03:58 PM
  5. Replies: 1
    Last Post: 2007-03-19, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •