Author Topic: Flag if dimension is not associative  (Read 10188 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
Flag if dimension is not associative
« on: January 23, 2008, 11:08:28 AM »
Hey guys,

Do any of you have a routine which will flag any dims which are not associative? The new place is dimensioning in paper space and it's driving me bonkers

Josh Nieman

  • Guest
Re: Flag if dimension is not associative
« Reply #1 on: January 23, 2008, 11:14:48 AM »
"Associative" is a read-only (unless it's associative, you can turn that off, but it's a one-way street from the properties menu) and is a listed property of a dimension object, so you could probably just find out what dxf value is tied to that, and check for the corresponding number.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Flag if dimension is not associative
« Reply #2 on: January 23, 2008, 11:20:34 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
Re: Flag if dimension is not associative
« Reply #3 on: January 23, 2008, 02:37:30 PM »
another thing that might be useful for me at this point would be an alert when any of my dimensions become non associative instead of discovering it after i've done a bunch of work and have to wind up redoing one or the other. i haven't been able to find a completed routine on the net which is somewhat surprising to me.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Flag if dimension is not associative
« Reply #4 on: January 24, 2008, 09:06:43 AM »
This won't flag your dimensions automatically, but running the routine and selecting all at the prompt will flag all dimensions with overrides:

Code: [Select]
(defun c:FlagForcedDims( / ss1 ssl indx obj to)
  (cond
    ((null (setq ss1 (ssget '((0 . "DIMENSION")))))
     nil
     )
    ((= 0 (setq ssl (sslength ss1)))
     (princ "\nNothing selected.")
     )
    (T
     (setq indx -1)
     (while (> ssl (setq indx (1+ indx)))
       (setq
obj (vlax-ename->vla-object (ssname ss1 indx))
to (vla-get-textoverride obj)
)
       (if (= "" to)
nil
(progn
   (vla-put-textcolor obj 1)
   (vla-put-lineweight obj 80)
   (vla-put-textoverride obj (strcat to " measures " (rtos (vla-get-measurement obj))))
)
)
       )
     )
    )
  (princ)
  )

The result looks like this:

daron

  • Guest
Re: Flag if dimension is not associative
« Reply #5 on: January 24, 2008, 09:06:55 AM »
It could be because most people avoid assoc. dims. because of the one-way street and the possibility of easy disassociation.

ELOQUINTET

  • Guest
Re: Flag if dimension is not associative
« Reply #6 on: January 24, 2008, 09:42:34 AM »
i appreciate the try mv but i'm not sure this is what i'm after. they are dimensioning object that are in paperspace in paperspace here. i am building their library and am not accustomed to this method and sometimes move things and leave behind dimensions or by habit stretch via grips or add one note then copy it. all of these practices and probably more to come are disassociating the dimensions from the objects and I need a quick way of checking that I have not made a boo boo before determining that a drawing is complete. i am really in need of this in a bad way so if someone could be so kind as to help me out it would save me from pulling alot of hair out.

Josh Nieman

  • Guest
Re: Flag if dimension is not associative
« Reply #7 on: January 24, 2008, 09:55:08 AM »
What if you used the same code as was written, but instead of changing the text... maybe it'd change the dimlines and text colors to something that would stand out from the rest of your drawing like a lime green or magenta or something bright?

That was you could run it... all non-conforming dimensions would be given a NEON GLOW so to speak... and you could quickly see which were 'off' and fix them... then select all dims and return to normal settings.

ELOQUINTET

  • Guest
Re: Flag if dimension is not associative
« Reply #8 on: January 24, 2008, 11:18:36 AM »
that would work much better. I just need a visual cue to tell me if any dimensions have lost their association. Thanks

Josh Nieman

  • Guest
Re: Flag if dimension is not associative
« Reply #9 on: January 24, 2008, 12:07:09 PM »
Where his says:

Code: [Select]

   (vla-put-textcolor obj 4)
   (vla-put-lineweight obj 4)
   (vla-put-textoverride obj 4)

replace those lines with:

Code: [Select]
            (setq JN (subst (62 . 4) (assoc 62 JN) JN))


Did I do this right?  I'm trying to change the 'color' value to CYAN (4) :|  I'm totally confused now, though.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Flag if dimension is not associative
« Reply #10 on: January 24, 2008, 12:13:28 PM »
This won't flag your dimensions automatically, but running the routine and selecting all at the prompt will flag all dimensions with overrides:

Code: [Select]
(defun c:FlagForcedDims( / ss1 ssl indx obj to)
  (cond
    ((null (setq ss1 (ssget '((0 . "DIMENSION")))))
     nil
     )
    ((= 0 (setq ssl (sslength ss1)))
     (princ "\nNothing selected.")
     )
    (T
     (setq indx -1)
     (while (> ssl (setq indx (1+ indx)))
       (setq
obj (vlax-ename->vla-object (ssname ss1 indx))
to (vla-get-textoverride obj)
)
       (if (= "" to)
nil
(progn
   (vla-put-textcolor obj 1)
   (vla-put-lineweight obj 80)
   (vla-put-textoverride obj (strcat to " measures " (rtos (vla-get-measurement obj))))
)
)
       )
     )
    )
  (princ)
  )

The result looks like this:


If the text will be " <> " your program will give a mistake

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Flag if dimension is not associative
« Reply #11 on: January 24, 2008, 12:21:46 PM »
My old program...

Code: [Select]
(defun d-orig (/ EN SS)
 ;;(d-orig)
 (if (setq ss (ssget "_X" '((0 . "DIMENSION") (-4 . "<AND") (1 . "*?*") (1 . "~*<>*") (-4 . "AND>"))))
  (foreach x (mapcar (function cadr) (ssnamex ss))
   (setq en (entget x))
   (entmod (subst (cons 1 (strcat (cdr (assoc 1 en)) "{\\C1; (Original: <>) }")) (assoc 1 en) en))
   (entupd x)
  ) ;_  foreach
 ) ;_  if
)

ELOQUINTET

  • Guest
Re: Flag if dimension is not associative
« Reply #12 on: January 24, 2008, 12:34:38 PM »
ummm Elpanov you are confusing me. The routine I am looking for will tell me if a dimension is non associative. I do not need to know if the dimension has been overridden. Well I do but I already have a routine that I'm happy with for that. That is what yours is doing right?

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Flag if dimension is not associative
« Reply #13 on: January 24, 2008, 12:38:27 PM »
ummm Elpanov you are confusing me. The routine I am looking for will tell me if a dimension is non associative. I do not need to know if the dimension has been overridden. Well I do but I already have a routine that I'm happy with for that. That is what yours is doing right?
As an example, I have replaced the text of the size on " <> mm " it does not mean, that the size will be not exact!

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Flag if dimension is not associative
« Reply #14 on: January 24, 2008, 12:43:59 PM »