Results 1 to 4 of 4

Thread: AutoLisp Problems

  1. #1
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default AutoLisp Problems

    I'm trying to use of of Lee Mac's attribute functions but I can't seem to get it to work. Any help is appreciated.

    Code:
    (defun LM:setattributevalues ( blk lst / enx itm )
        (while (= "ATTRIB" (cdr (assoc 0 (setq enx (entget (setq blk (entnext blk)))))))
            (if
                (and
                    (setq itm (assoc (cdr (assoc 2 enx)) lst))
                    (entmod (subst (cons 1 (cdr itm)) (assoc 1 enx) enx))
                )
                (entupd blk)
            )
        )
    )
    (defun c:clr ()
     (setq blk (ssget))
     (setq lst
      '(
       ("REV:" . "-")
       ("DESC:" . "x")
       ("ADDITIONAL_INFO:" . "x")
       ("REV_DATE:" . "x")
       ("TA:" . "x")
       ("OA:" . "x")
       ("DD:" . "x")
         )
      )
    (LM:SetAttributeValues blk lst)
    (princ)
    )

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: AutoLisp Problems

    Please provide a link to where you got this. That would be the best place to find help. As it seems to modify a block with corresponding attributes you need that block for it to work. I've never seen Lee post code without any explanation.

  3. #3
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: AutoLisp Problems

    In the second function you set the value of blk to a selection set not an entity name

    (Setq blk ( Ssname (ssget) 0))
    Last edited by peter; 2016-04-01 at 05:45 AM. Reason: Typo

  4. #4
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default Re: AutoLisp Problems

    Thanks Peter, works perfectly now!! I figured it would be something simple.

    Tom, the link where I got Lee's function is here: http://www.lee-mac.com/attributefunctions.html

Similar Threads

  1. AutoLISP Help
    By michael.viall919828 in forum AutoLISP
    Replies: 2
    Last Post: 2014-01-24, 09:28 PM
  2. AutoLISP Going Away?
    By Bill Harper in forum AutoLISP
    Replies: 5
    Last Post: 2010-02-20, 07:12 PM
  3. AutoLisp Help
    By mboyer in forum AutoCAD Customization
    Replies: 3
    Last Post: 2007-08-23, 04:36 PM
  4. AutoLisp or VBA
    By red2002yzfr1 in forum ACA General
    Replies: 6
    Last Post: 2006-05-22, 02:36 PM
  5. autolisp help
    By guyogordo in forum AutoLISP
    Replies: 9
    Last Post: 2004-09-20, 12:15 AM

Posting Permissions

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