Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/30/2019 in all areas

  1. If you're merely looking to remove any & all dimension text overrides, you can try the following: (defun c:removedimtextoverride ( / i s x ) (if (setq s (ssget "_X" '((0 . "*DIMENSION") (1 . "*?*")))) (repeat (setq i (sslength s)) (setq i (1- i) x (entget (ssname s i)) ) (entmod (subst '(1 . "") (assoc 1 x) x)) ) (princ "\nNo dimension measurements have been overridden.") ) (princ) )
    1 point
  2. dim.dwg It probably doesn't do all you want, but here's a start. It works only for horizontal dimensions. If the first extension line origin of obj1 = the second extension line origin of obj2 => then it will push both points down to the y-value of the dimension line. Try it on my file first, then see if it fits your needs, let me know. ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-the-value-of-a-assoc/td-p/8738111 ;; modify 1 property of an object (defun entmod_property (psn tag YourNewValue / ) (entmod (setq psn (subst (cons tag YourNewValue) (assoc tag psn) psn))) ) (defun c:test ( / obj ent) (setq ent (entget (setq obj (car (entsel))) )) (entmod_property ent 14 (list 10. -4.)) ) (defun samepoint (p1 p2 / small_number) (setq small_number 0.01) (< (distance p1 p2) small_number) ) ;; Move Def point on Dimension line when Overlap (defun c:mddo ( / ss i j item item2 obj obj2 ent ent2 datalist) (princ "\nSelect dim objects: ") (setq ss (ssget (list (cons 0 "DIMENSION")))) (setq i 0) (setq datalist (list)) (repeat (sslength ss) (setq obj (ssname ss i)) (setq ent (entget obj)) (setq datalist (append datalist (list (list (cdr (assoc 13 ent)) ;; left arm (cdr (assoc 14 ent)) ;; right arm (cdr (assoc 10 ent)) ;; bottom position ) ))) (setq i (+ i 1)) ) ;; now let's analyze the data (setq i 0) (foreach item datalist (setq obj (ssname ss i)) (setq ent (entget obj)) (setq j (+ i 1)) (while (setq item2 (nth j datalist)) (setq obj2 (ssname ss j)) (setq ent2 (entget obj2)) ;; look if the first extension line origin of obj1 = the second extension line origin of obj2 (if (samepoint (nth 0 item) (nth 1 item2)) (progn (entmod_property ent 13 (list (nth 0 (nth 0 item)) (nth 1 (nth 2 item)) ;; x position stays, y position of bar gets taken )) (entmod_property ent2 14 (list (nth 0 (nth 1 item2)) (nth 1 (nth 2 item2)) ;; x position stays, y position of bar gets taken )) ) ) (setq j (+ j 1)) ) (setq i (+ i 1)) ) )
    1 point
×
×
  • Create New...