+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default HELP to include "AcDbAlignedDimension" code for a "Dimension deleting" LISP

    Registered forum members do not see this ad.

    Anyone can help to see where i can insert "AcDbAlignedDimension" to allow aligned dimension to be deleted as well.

    Got this LISP from another website.

    Thanks

    Code:
    ;;  DELETE DIMENSION BASE ON SELECTIVE BLOCKS   ;;
    (defun c:DIMDELS (/ ss i sn name lst)
      (vl-load-com)
    ;;;        ------ Tharwat 15. June. 2012 -----      ;;;
    ;;; codes to delete all dimensions entities in the  ;;;
    ;;;                selected blocks                  ;;;
      (if (not acdoc)
        (setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
      )
      (if (setq ss (ssget "_:L" '((0 . "INSERT"))))
        (repeat (setq i (sslength ss))
          (setq sn (ssname ss (setq i (1- i))))
          (if (not (member (setq name (cdr (assoc 2 (entget sn)))) lst))
            (progn
              (setq lst (cons name lst))
              (vlax-for each (vla-item (vla-get-blocks acdoc) name)
                (if (eq (vla-get-objectname each) "AcDbRotatedDimension")
                  (vla-delete each))
              )
            )
          )
        )
        (princ)
      )
      (if ss (vla-regen acdoc AcAllviewports))
      (princ)
    )

  2. #2
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,249

    Default

    Replace the highlighted object name as per the one you want to change .
    Quote Originally Posted by vernonlee View Post
    Code:
     (if (eq (vla-get-objectname each) "AcDbRotatedDimension")
           ...
         ...

  3. #3
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default

    Quote Originally Posted by Tharwat View Post
    Replace the highlighted object name as per the one you want to change .
    I have tested that previously & yes it works.

    To clarify, I am not sure how to but what I would like to is to have both to be included in the LISP. Possible?

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,249

    Default

    Quote Originally Posted by vernonlee View Post
    I have tested that previously & yes it works.

    To clarify, I am not sure how to have both to be included in the LISP. Possible?
    Yes , replace it with this .

    Code:
    (if (wcmatch (vla-get-objectname each) "AcDbRotatedDimension,AcDbAlignedDimension")
    ........

  5. #5
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default

    Thanks Tharwat. It works.

    Apologies I forgotten that i wanted to include angled dimension as well. I can only find the code for aligned dimension but not for angle. Any advise on that?

  6. #6
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,249

    Default

    Quote Originally Posted by vernonlee View Post
    Thanks Tharwat. It works.
    You are welcome .

    Quote Originally Posted by vernonlee View Post
    Apologies I forgotten that i wanted to include angled dimension as well. I can only find the code for aligned dimension but not for angle. Any advise on that?
    Add the following as I did in the last modification .

    Code:
    "AcDb2LineAngularDimension"
    I have just saw your PM into the other forum , anyway I am just following your request here

  7. #7
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default

    Thanks bro for your help

    PMed you at the other forum at first. Did not know you are active here as well

  8. #8
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2017
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,249

    Default

    Quote Originally Posted by vernonlee View Post
    Thanks bro for your help

    PMed you at the other forum at first. Did not know you are active here as well
    You are welcome

  9. #9
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default

    Found out can add the following as well.

    AcDbRadialDimension
    AcDbDiametricDimension

  10. #10
    Super Member
    Using
    AutoCAD 2015
    Join Date
    Jul 2014
    Posts
    503

    Default

    Registered forum members do not see this ad.

    It now deletes every dimension known to man ............ except Arch Length

    EDIT
    Just found the answer

    AcDbArcDimension

Similar Threads

  1. Replies: 6
    Last Post: 25th Apr 2018, 09:04 pm
  2. I collated some"auto dimension" code,,Share to everyone.
    By highflybird in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 26th Apr 2014, 01:47 am
  3. Organize into groups with "Hide" and "display" code
    By liuhaixin88 in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 25th Feb 2014, 07:12 am
  4. Export properties ("measurement") of "Aligned Dimension" to Excel
    By nhatquyelec in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 1st Feb 2013, 07:58 am
  5. Dimension style "adds" number "1/8" as suffix
    By enemigoman in forum AutoCAD General
    Replies: 4
    Last Post: 26th Apr 2012, 04:15 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