Good morning, I believe I need a little help here I'm trying to add an if statement to your dimension code and when
I do it returns bad argument type: lselsetp nil. I believe the solution maybe something I'm not seeing or maybe
it's not applicable with this type of code I'm pretty new to lisp but I think the error means selection set is nil
somewhere in the meantime I'm going to keep trying to figure it out, but this is what I've added so far. The statement is something I've borrowed from another code and what it did in that code is it didn't try to reassociate dimensions
that were already associated with objects.
(defun c:DMU (/ ss i ent p13 p14)
(if (setq ss (ssget '((0 . "DIMENSION"))))
(repeat (setq i (sslength ss))
(setq ent (ssname ss (setq i (1- i))))
(if (and (vl-position (cdr (assoc 100 (reverse (entget ent)))) '("AcDbAlignedDimension" "AcDbRotatedDimension" "AcDbOrdinateDimension"))
(setq p13 (cdr (assoc 13 (entget ent))))
(setq p14 (cdr (assoc 14 (entget ent))))
)
(command "cmdecho" "0" "pickbox" "1" "_.DIMREASSOCIATE" "ss" ent "" "_end,_mid,_quadrant,_center" p13 "_end,_mid,_quadrant,_center" p14 "pickbox" "6" "cmdecho" "1"))))
(princ)
)
(if (< 0 (sslength ss))
(progn
(princ (strcat "\n: -------------------------\n >>> " (itoa (setq len (sslength ss))) (if (> len 1) " dis-ASSociated Dimensions" " dis-ASSociated Dimension") " found, please RE-ASSOCIATE. <<< \n: -------------------------\n"))
(sssetfirst nil ss)
)
(princ "\n: -------------------------\n *** Nothing needs re-ASSociatating *** \n: -------------------------\n")
)
(setq ss nil)
(*error* nil)
(vl-load-com) (princ)