+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25
  1. #1
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Aug 2010
    Posts
    18

    Default Dimension String Verification

    Registered forum members do not see this ad.

    I need to be able to make sure that there are Dimension Strings in a CAD file that range from 0 to 210. So each dimension string has a number ("01") as the unit. I want to be able to pull an external file (txt) off all the numbers that are NOT in the file.

    So if 200 and 151 were not in the file it would give me that.

    Any thoughts?

  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,718

    Default

    A rough estimate, hacked together:

    Code:
    (defun c:test ( / _PadLeft )
    
      (defun _PadLeft ( s l )
        (if (< (strlen s) l) (_PadLeft (strcat "0" s) l) s)
      )
    
      (
        (lambda ( i / l )
          (while (<= (setq i (1+ i)) 210)
            (or (ssget "_X" (list '(0 . "DIMENSION") (cons 1 (_PadLeft (itoa i) 3))))
                (setq l (cons i l))
            )
          )
          (print l)
        )
        -1
      )  
    )
    File:
    Code:
    (defun c:test ( / _PadLeft f )
    
      (defun _PadLeft ( s l )
        (if (< (strlen s) l) (_PadLeft (strcat "0" s) l) s)
      )
      
      (if (setq f (getfiled "Output File" "" "txt" 1))
        (
          (lambda ( i / l )
              (while (<= (setq i (1+ i)) 210)
                (or (ssget "_X" (list '(0 . "DIMENSION") (cons 1 (_PadLeft (itoa i) 3))))
                    (setq l (cons i l))
                )
              )
            (setq f (open f "a")) (princ l f) (close f)
          )
          -1
        )
      )
      (princ)
    )
    Last edited by Lee Mac; 22nd Sep 2010 at 10:43 pm.
    Lee Mac Programming

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

    Just another Swamper

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

    Default

    *IF* I understand you correctly, using Visual LISP, look into the TextOverride property of the Dimension object(s).
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Aug 2010
    Posts
    18

    Default

    Quote Originally Posted by RenderMan View Post
    *IF* I understand you correctly, using Visual LISP, look into the TextOverride property of the Dimension object(s).

    That is exactly what i need.

  5. #5
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Aug 2010
    Posts
    18

    Default

    Lee Mac - This works but it's reporting all the dimension strings that are in the CAD file. Even the ones that i deleted and purged out of the drawing.

    I deleted "178" and "180" from the file, saved and ran the LISP routine. 178 and 180 showed up on the report.

    Is there a way to show which ones are missing versus which ones are in the file? We have the criteria (0-210)

  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,718

    Default

    What is the exact format of these dimension strings?
    Lee Mac Programming

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

    Just another Swamper

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

    Default

    FYI, Lee:
    Code:
    (wcmatch "25" "*5")
    T
    I liked the idea.
    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...

  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,718

    Default

    Quote Originally Posted by alanjt View Post
    FYI, Lee:
    Code:
    (wcmatch "25" "*5")
    T
    I liked the idea.
    Ahh - overlooked that fact

    Thanks mate. I need more sleep lately
    Lee Mac Programming

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

    Just another Swamper

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

    Default

    Updated
    Lee Mac Programming

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

    Just another Swamper

  10. #10
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Aug 2010
    Posts
    18

    Default

    Registered forum members do not see this ad.

    The exact format....

    Linear dimension string
    numbers in quotes ("02")

    what else do you need?

Similar Threads

  1. The layer verification windows are nuisance
    By Kharnivour in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 22nd Jan 2010, 11:37 am
  2. Line Direction Verification
    By MiGo in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 16th Dec 2009, 09:35 pm
  3. String with a mind of its own
    By Freerefill in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 15th May 2009, 07:57 pm
  4. List to String
    By Lee Mac in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 29th Dec 2008, 02:20 am
  5. string text
    By brassworks in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 6th Oct 2006, 03:04 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