Jump to content

Request: Find all dimensions with an overide??


ILoveMadoka

Recommended Posts

I don't even know where to begin with this one and I'm sure someone can code this before I can even research it.

 

I'd like to find all dimensions in a drawing that have an overide and change their color to Magenta.

 

We have a terrible time getting drafters to draw correctly and without manually checking every dimension I'd like to be able to see where they "took creative liberties."

 

While I'd like to ask if this is difficult, I know current company doesn't

find many requests difficult.

 

Thank all of you for everything you've helped me and others with.

Link to comment
Share on other sites

Hi,

 

Something like this ?

 

(defun c:test (/ ss n ent elst)
 (if (setq n  0
           ss (ssget "_X"
                     '((0 . "DIMENSION") (-4 . "<not") (1 . "") (-4 . "not>"))
              )
     )
   (while (setq ent (ssname ss n))
     (setq elst (entget ent) n (1+ n))
     (entmod (if (not (assoc 62 elst))
               (append elst '((62 . 6)))
               (subst '(62 . 6) (assoc 62 elst) elst)
             )
     )
   )
 )
 (princ)
)

Link to comment
Share on other sites

Here's my stab at it

(defun c:test (/ ss1 sslen cnt obj tst)
 (vl-load-com)
 (setq ss1 (ssget "x" '((0 . "*DIMENSION*")))
   sslen (sslength ss1)
       cnt 0)
 (repeat sslen
   (setq obj (vlax-ename->vla-object (ssname ss1 cnt)) 
         tst (vlax-get obj 'TextOverride))
    (if (vl-string->list tst)
     (vlax-put-property obj 'Color 6)
      )
   (setq cnt (1+ cnt))
 )
 (princ)
 )

Link to comment
Share on other sites

I tested it and an override is an override.

Is someone uses the actual dimension or AND adds a note

it is still flagged.

 

*PERFECT*

Link to comment
Share on other sites

if overwrite text includes , how would you filter that dimension out of the selection?
(ssget "_X"
      '((0 . "DIMENSION")
        (-4 . "<not")
        (-4 . "<or")
        (1 . "")
        (1 . "*<>*")
        (-4 . "or>")
        (-4 . "not>")
       )
)

 

or, a little more cryptic:

(ssget "_X"
      '((0 . "DIMENSION") (-4 . "<not") (1 . "") (-4 . "not>") (1 . "~*<>*"))
)

Link to comment
Share on other sites

Perfect Gile, thank you very much. It would take me for ever to figure out how to work things out with those wild charcters.

Thanks again.

Paul.

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...