+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
  1. #11
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    4,044

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by alanjt View Post
    i thought the point was the replace the nth item, not every matching item.
    *Touches finger to nose*

    ... That's why Stefan (here), and Lee (in the linked thread) advise against using SUBST.
    "Potential has a shelf life." - Margaret Atwood

  2. #12
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,050

    Default

    Quote Originally Posted by RenderMan View Post
    *Touches finger to nose*

    ... That's why Stefan (here), and Lee (in the linked thread) advise against using SUBST.
    Oops, his and liberty's post as one.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  3. #13
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    135

    Default

    OK - I see the point in not using subst.

    I would like to tinker around with this myself a bit but don't have an AutoLisp interpreter handy at the moment and my fingers are really itching!
    Could someone copy the following code and tell me what is returned? Thanks!
    Code:
    (setq mylist '(a b c d e f))
    (setq flist (cons (nth 3 mylist) nil))

  4. #14
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    4,044

    Default

    Quote Originally Posted by LibertyOne View Post
    I would like to tinker around with this myself a bit but don't have an AutoLisp interpreter handy at the moment and my fingers are really itching!
    Could someone copy the following code and tell me what is returned?
    "Potential has a shelf life." - Margaret Atwood

  5. #15
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    135

    Default

    Quote Originally Posted by RenderMan View Post
    ok - no answer is also an answer...

  6. #16
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    4,044

    Default

    Quote Originally Posted by LibertyOne View Post
    ok - no answer is also an answer...
    I read your request; the "Implied Facepalm" image IS what was returned on my end...

    Okay, I'll stop... Since you were a good sport about it, here you go :

    Code:
    _$ (setq mylist '(a b c d e f))
    (A B C D E F)
    _$ (setq flist (cons (nth 3 mylist) nil))
    (D)
    _$
    "Potential has a shelf life." - Margaret Atwood

  7. #17
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    135

    Default

    Thanks for the reply, RenderMan. I really have to complain a bit now that I have no access to an AutoCAD command line. Being able to write code the last 13 years and then having no AutoCAD is like going cold-turkey!

    I was assuming that (D) was going to be returned but wasn't 100% sure. (About 2% was thinking (A B C D)) I've been reading about cons cells lately, and wanred to practice...

  8. #18
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    4,044

    Default

    Quote Originally Posted by LibertyOne View Post
    Thanks for the reply, RenderMan.
    You're welcome.

    Quote Originally Posted by LibertyOne View Post
    I really have to complain a bit now that I have no access to an AutoCAD command line. Being able to write code the last 13 years and then having no AutoCAD is like going cold-turkey!
    I have nowhere near your experience, but if things do not improve at my place of work in the very immediate future, I too may be able to relate to your dilemma.
    "Potential has a shelf life." - Margaret Atwood

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

    Default

    Registered forum members do not see this ad.

    Thanks for the nod Renderman, appreciated

    FYI, here is the related function on my site:

    http://lee-mac.com/substn.html
    Lee Mac Programming

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

    Just another Swamper

Similar Threads

  1. Replace Z
    By hotphoot in forum AutoCAD General
    Replies: 2
    Last Post: 25th Oct 2010, 05:54 pm
  2. Find & Replace
    By dbroada in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 26th Jun 2010, 09:54 am
  3. square heel & throat elbows
    By Regulator26 in forum MEP
    Replies: 2
    Last Post: 19th Feb 2010, 03:38 pm
  4. VBA-Block replace
    By rhs in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 16th Jul 2008, 09:41 am
  5. find and replace
    By cooldude in forum AutoCAD General
    Replies: 1
    Last Post: 4th Jun 2008, 01:24 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