Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Easy way to check all dimensions are associative?

Dennis.Meehan
Enthusiast

Easy way to check all dimensions are associative?

Dennis.Meehan
Enthusiast
Enthusiast

Associative dimensions on drawings become dissociated. Is there a routine that can check all of the dimensions in a group of drawings and flag dimensions that are not associative?

 

Can I make a dimension that becomes dissociated change color to flag it?

0 Me gusta
Responder
300 Vistas
2 Respuestas
Respuestas (2)

cadffm
Consultant
Consultant
0 Me gusta

ВeekeeCZ
Consultant
Consultant

Try this. It selects both, not and partially associated dims.

 

(defun c:SelDimUnAssociated ( / isDimAssoc? m s i e)
  
  ; by Vl. Michl CADStudio
  ; returns nil or assoc point number
  
  (defun isDimAssoc? (diment / elst dict)
    (and (setq elst (entget diment))
	 (setq dict (cdr (assoc 360 elst)))
	 (setq elst (entget dict))
	 (setq elst (entget (cdr (assoc 360 elst)))))
    (cdr (assoc 90 elst)))
  
  ; ------------------------------------------------------
  
  (princ "\nSelect dims to analyze associativity ... ")
  (setq m (ssget "_I" '((0 . "DIMENSION"))))
  
  (if (setq s (ssget '((0 . "DIMENSION"))))
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i))))
      (if (= (isDimAssoc? e)
	     (cadr (assoc (cdr (assoc 100 (reverse (entget e))))
			  '(("AcDbAlignedDimension" 3)
			    ("AcDbRotatedDimension" 3)
			    ("AcDbRadialDimension" 2)
			    ("AcDbDiametricDimension" 2)
			    ("AcDb3PointAngularDimension" 7)
			    ("AcDb2LineAngularDimension" 15)
			    ("AcDbOrdinateDimension" 2)
			    ("AcDbRadialDimensionLarge" 2)
			    ("AcDbArcDimension" 7)
			    ))))
	(ssdel e s))))
  (if m (sssetfirst nil nil))
  (if (and s (not (zerop (sslength s))))
    (sssetfirst nil s))
  (princ)
  )