+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Full Member
    Computer Details
    TheNewGuy's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2009
    Join Date
    Mar 2009
    Location
    Cincinnati,Ohio
    Posts
    94

    Default How to cause recorded macro code to be visible in the VBA editor.

    Registered forum members do not see this ad.

    I would like to know if there is a way to make the code from a user recorded macro to be visible when you go to the VBA editor screen.(like in excel) In excel I can use this to help teach myself the coding language, and I would like to try doing the same in autocad so I can start to write my own lisp programs. Thanks for any input and help!

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quote Originally Posted by TheNewGuy View Post
    I would like to know if there is a way to make the code from a user recorded macro to be visible when you go to the VBA editor screen.(like in excel) In excel I can use this to help teach myself the coding language, and I would like to try doing the same in autocad so I can start to write my own lisp programs. Thanks for any input and help!
    Bear in mind that VBA and LISP are two very different things. If you want to write LISP, you will need to write it from scratch, and won't be able to "record" anything that you do. I can't speak for VBA, as, honestly, I have never programmed with it - but I am sure others will have something to say

    As for LISP, I use the Visual LISP Editor in ACAD (type VLIDE at command line, then File, New File).

    There are dozens of tutorial sites out there for you to learn from, and, if you're still stuck, just post a thread on here, and we will help you all we can

    Cheers

    Lee
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,065

    Default

    VBA - I've not encountered a user recorded macro in older AutoCAD implementations. I cartainly can't see it on my 2008 version.

    I am looking at a nice new 2010 box atm so once we get some time I will have a look at URMs but until then I can't help.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quote Originally Posted by dbroada View Post
    I am looking at a nice new 2010 box atm...
    You lucky lad
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  5. #5
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,065

    Default

    Quote Originally Posted by Lee Mac View Post
    You lucky lad
    but by the time our parent company do all their "tests" on any piece of software and allow IT to (tell me to) install it, I will be looking at a nice new 2012 box.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quote Originally Posted by dbroada View Post
    but by the time our parent company do all their "tests" on any piece of software and allow IT to (tell me to) install it, I will be looking at a nice new 2012 box.
    Haha, I know what you mean

    But I'd be happy with the wait - I'm still stuck with '04... (best release.. ever.)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #7
    Full Member
    Computer Details
    TheNewGuy's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2009
    Join Date
    Mar 2009
    Location
    Cincinnati,Ohio
    Posts
    94

    Default

    Sorry I needed to update my user CP because now I've got this fancy new 2009!!! I thought that the language used in VBA would be similar to what is used in a LISP. Is that not the case? And So I guess I would like to see if someone (Ideally NOT LEE MAC as he has done enough for me already) would mind writing a short lisp that I can use as a starting point to learn from.
    Attached Files

  8. #8
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Haha "NOT LEE MAC" ... you should be so lucky...

    The methods used are similar, but the format and language is quite different.

    As for a LISP to "learn from", your best bet would be to check out a tutorial site, like Jeffery Sanders, or AfraLISP - they will step you through it carefully, and use appropriate LISPs.

    But, as you asked for it, below is one of my very first LISPs

    Code:
    (defun c:addone (/ ent count)
        (while  (setq ent (car (entsel "\nSelect Numerical Text: ")))
            (setq ent (entget ent))
            (setq count (atoi (cdr (assoc 1 ent))))
            (setq count (+ 1 count))
            (setq ent (subst (cons 1 (itoa count)) (assoc 1 ent) ent))
            (entmod ent)
        ) ; end while
        (princ)
    )
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  9. #9
    Full Member
    Computer Details
    TheNewGuy's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2009
    Join Date
    Mar 2009
    Location
    Cincinnati,Ohio
    Posts
    94

    Default

    Your too much Lee Mac I think I'll be indebted to you for a long time at this rate! Thanks for your help. Again.....

  10. #10
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,065

    Default

    Registered forum members do not see this ad.

    as I hinted above, I have yet to install our copy of 2009 or 2010 ut from what I saw the macro produced is in the form of a script file with place holders for variables. Script files have been covered extensively here (a lot of them by me) but are one of the best kept secrets in AutoCAD. So powerful but used by only a few. Have a search here then compare with your 2009 macro.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

Similar Threads

  1. Recorded Macro error
    By Byron md in forum SolidWorks
    Replies: 1
    Last Post: 13th Feb 2009, 03:21 pm
  2. Visible Attributes
    By gav in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 19th Nov 2008, 02:29 pm
  3. What is AutoCAD 2008 using for Macro Code?
    By RMS in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 30th May 2007, 12:44 am
  4. Ruler not visible in Mtext editor
    By Autodesk in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 8th Nov 2006, 07:40 pm
  5. bhatch visible and non-visible areas
    By Jabba in forum AutoCAD Drawing Management & Output
    Replies: 10
    Last Post: 17th Nov 2004, 02:02 pm

Bookmarks

Posting Permissions

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