+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Junior Member
    Using
    AutoCAD 2011
    Join Date
    Jun 2011
    Posts
    14

    Default Lee Mac's Update Title Block

    Registered forum members do not see this ad.

    Has anyone used Lee Mac's Update Title Block Routine with a wildcard in the layout column. As an example we have layouts with the following names:

    10-101.A and 10-101.B

    We would like the title block to be updated identically on both 10-101.A and 10-101.B.

    I would like to update the Lisp routine to accept a wildcard so on the CSV file in the layout column I can enter 10-101*.

    Is this possible?

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,559

    Default

    Change Line 158 from:

    Code:
    (setq val (cdr (assoc (strcase (cdr (assoc 410 (entget ent)))) lst)))
    to:
    Code:
    (setq lay (strcase (cdr (assoc 410 (entget ent))))
          val (vl-some (function (lambda ( x ) (if (wcmatch (car x) lay) (cdr x)))) lst)
    )
    Untested.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  3. #3
    Junior Member
    Using
    AutoCAD 2011
    Join Date
    Jun 2011
    Posts
    14

    Default Testing

    I tested the above code and it did not work correctly.

    As a test I did the following:

    Created a CSV file with a Layout Column containing 10-101
    Created a Layout tab with 10-101
    Ran UTB
    Success

    Created new layout tab 10-102.A
    Created new layout tab 10-102.B
    Changes the CSV layout column containing 10-101 to 10-102*
    Ran UTB
    Got false positive-"All attributed are up to date"

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,559

    Default

    I had the wcmatch arguments around the wrong way:

    Code:
    (setq lay (strcase (cdr (assoc 410 (entget ent))))
          val (vl-some (function (lambda ( x ) (if (wcmatch lay (car x)) (cdr x)))) lst)
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  5. #5
    Junior Member
    Using
    AutoCAD 2011
    Join Date
    Jun 2011
    Posts
    14

    Default Correct Code

    This change worked as intended. Thanks for the update.

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,559

    Default

    Quote Originally Posted by Craisbeck View Post
    This change worked as intended. Thanks for the update.
    You're welcome Cory.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  7. #7
    Junior Member
    Using
    AutoCAD 2011
    Join Date
    Jun 2011
    Posts
    14

    Default 2013 AutoCad

    Registered forum members do not see this ad.

    Anyone have any problems running UTB on 2013 autocad. It works fine on our 2012 versions, but on our 2013 versions it places the identical information in all the fields on all the layout tabs?

Similar Threads

  1. Update title block attributes in multiple drawings
    By t357 in forum AutoLISP, Visual LISP & DCL
    Replies: 142
    Last Post: 12th Dec 2016, 09:38 am
  2. Update Attribute Title block
    By andy_gs in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 31st Oct 2012, 04:49 pm
  3. Automatically Update Title block lisp HELP!
    By Millsy29 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 15th Jul 2010, 05:29 pm
  4. Update the attribute title block
    By andy_gs in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 4th May 2010, 04:22 am
  5. Title Block Update
    By eddablin in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 18th Apr 2009, 01:35 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