+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    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
    19,319

    Default Building Association Lists: A Simple Block Counter [AutoLISP Tutorial]

    Registered forum members do not see this ad.

    I've spent some time writing up the following tutorial which aims to demonstrate how to construct a simple block counter and in the process give the user an introduction to association lists and dotted pairs:

    Building Association Lists: A Simple Block Counter


    The tutorial is a step-by-step walkthrough of the process of creating the block counter, with diversions here and there to explain the various concepts used by the program.

    Throughout the tutorial I've also tried to explain why every part of the code is used in the way that it is, rather than providing the reader with a block of code and leaving some parts without an explanation (for example, why the program should include (princ) or (prin1) as the last expression etc.).

    I welcome your feedback on the tutorial -

    Is it too simplified?
    Is it too long?
    Too boring?
    All of the above?

    Feel free to also point out any typos, as these can be difficult to spot when proof-reading your own work.

    Thanks,

    Lee
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  2. #2
    Senior Member
    Computer Details
    iconeo's Computer Details
    Operating System:
    Windows
    Discipline
    Multi-disciplinary
    iconeo's Discipline Details
    Occupation
    CAD Manager/Draftsman
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2017
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    259

    Default

    Oh man Xmas gift from Lee....

  3. #3
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,058

    Default

    Looks nice at first glance. Can't say that its too booring, long or simplified, otherwise you couldn't teach newbies like me.
    Merry xmas, guys!

  4. #4
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    204

    Default

    Nice Lee. Thanks for your tut. Can i translate it to my language and post somewhere with ur @ ?^^

  5. #5
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    555

    Default

    wow really appreciate Lee sacrifices this Xmas moment in writing this long tut for lisp community
    lambda not optimized.. ( apply '= "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" ) ; error: too many arguments

  6. #6
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,511

    Default

    First off : VERY nice !

    A suggestion

    Code:
    (setq sel ;; Assign the value returned by the following expression to the symbol 'sel'
    Maybe the term bind or bound is more apropos to LISP language than assign

    Maybe a small explanation or an example of a quoted symbol ( setq vs set )

    Code:
    (setq  sel "Valid")
    (set  'sel  "Valid)
    (set (quote sel) "Vaild")
    Your format is different from any I've seen before. It will be interesting to hear the feedback from a true newbie.

    Regard -David
    R12 (Dos) - A2K

  7. #7
    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
    19,319

    Default

    Quote Originally Posted by iconeo View Post
    Oh man Xmas gift from Lee....
    Merry Christmas!

    Quote Originally Posted by Grrr View Post
    Looks nice at first glance. Can't say that its too booring, long or simplified, otherwise you couldn't teach newbies like me.
    Merry xmas, guys!
    Thanks - I hope its comprehensible!

    Quote Originally Posted by ketxu View Post
    Nice Lee. Thanks for your tut. Can i translate it to my language and post somewhere with ur @ ?^^
    You are welcome to translate the tutorial and post it elsewhere, but I would ask that you include a note stating that the post is a translation with a link to the original tutorial on my site - thanks.

    Quote Originally Posted by hanhphuc View Post
    wow really appreciate Lee sacrifices this Xmas moment in writing this long tut for lisp community
    You're welcome, my pleasure.

    Quote Originally Posted by David Bethel View Post
    First off : VERY nice !
    Thank you David!

    Quote Originally Posted by David Bethel View Post
    A suggestion
    Code:
    (setq sel ;; Assign the value returned by the following expression to the symbol 'sel'
    Maybe the term bind or bound is more apropos to LISP language than assign

    Maybe a small explanation or an example of a quoted symbol ( setq vs set )
    Code:
    (setq  sel "Valid")
    (set  'sel  "Valid)
    (set (quote sel) "Vaild")
    Coincidentally, I had considered a few different ways of wording this, using phrases such as 'bind' or that the variable 'points' to the data, but I eventually chose 'assign' as I didn't want the language used in the tutorial to be overly technical so as to bewilder a beginner from the outset.

    Perhaps the process of how data is bound to a variable, or how the variable accesses the appropriate memory address is best covered in a separate tutorial.

    Quote Originally Posted by David Bethel View Post
    Your format is different from any I've seen before. It will be interesting to hear the feedback from a true newbie.
    Do you mean the process of building the program expression-by-expression, or the accompanying explanations?

    Thanks for the feedback - I appreciate it!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  8. #8
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,511

    Default

    I think I leaned more toward (boundp).

    As to the format, I guess I'd describe yours as the evolution of a program. Interesting concept.

    Maybe removing the comments from the previous example would emphasize the added calls. Just a thought.

    We all learn differently, so it will be interesting to to see other responses.

    -David
    R12 (Dos) - A2K

  9. #9
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2016
    Posts
    2

    Default Thanks

    Quote Originally Posted by Lee Mac View Post
    Merry Christmas!



    Thanks - I hope its comprehensible!



    You are welcome to translate the tutorial and post it elsewhere, but I would ask that you include a note stating that the post is a translation with a link to the original tutorial on my site - thanks.



    You're welcome, my pleasure.



    Thank you David!



    Coincidentally, I had considered a few different ways of wording this, using phrases such as 'bind' or that the variable 'points' to the data, but I eventually chose 'assign' as I didn't want the language used in the tutorial to be overly technical so as to bewilder a beginner from the outset.

    Perhaps the process of how data is bound to a variable, or how the variable accesses the appropriate memory address is best covered in a separate tutorial.



    Do you mean the process of building the program expression-by-expression, or the accompanying explanations?

    Thanks for the feedback - I appreciate it!

    My native language is Spanish and I am little experimented in AutoLISP but anyway your tutorial was completely understandable for me. I was needing exactly an association list for a routine.

    Thank you very much.

  10. #10
    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
    19,319

    Default

    Registered forum members do not see this ad.

    Excellent to hear gammnuevo! - I'm delighted that you found the tutorial to be clear & comprehensible, even with English as a second language!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. Association Lists
    By samifox in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 1st Apr 2013, 12:20 am
  2. Building a Lagoon Tutorial Civil 3D
    By SwChilly in forum Civil 3D & LDD
    Replies: 2
    Last Post: 8th Feb 2013, 11:23 pm
  3. modelling a building in 3ds max tutorial..
    By dondy in forum 3D Modelling
    Replies: 6
    Last Post: 6th Apr 2009, 08:54 pm
  4. Tutorial: Create a simple sheet set
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 16th Apr 2008, 08:40 pm
  5. Simple VB tutorial for AutoCAD
    By hyposmurf in forum Tutorials & Tips'n'Tricks
    Replies: 6
    Last Post: 23rd Oct 2005, 07:52 am

Tags for this Thread

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