Jump to content

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


vernonlee

Recommended Posts

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

 

;;  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)
)

Link to comment
Share on other sites

Replace the highlighted object name as per the one you want to change .

(if (eq (vla-get-objectname each) "[color="blue"]AcDbRotatedDimension[/color]")
      ...
    ...

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 .

 

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Thanks Tharwat. It works.

 

You are welcome .

 

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 .

 

"AcDb2LineAngularDimension"

 

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

Link to comment
Share on other sites

Thanks bro for your help :)

 

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

Link to comment
Share on other sites

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

 

EDIT

Just found the answer

 

AcDbArcDimension

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...