Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/07/2025 in all areas

  1. Fixing this will make the code a bit more complicated. Wait
    1 point
  2. I just saw your drawing The problem is that the code assumes that all the origin points of each dimension are aligned. The cases in which they are not, are not contemplated in the code. That is, the code is intended for the 'dimaligned' command.
    1 point
  3. for the case when measurements are taken along a line with bends dim.dwg grupDIMs.lsp
    1 point
  4. Please copy and test the code again. I have changed something.
    1 point
  5. I have improved the algorithm for calculating the displacement. This displacement will always be done in the direction of the others. I hope it helps you (defun c:agrupaDIMs (/ n conj ent lstent pt pt1 pt2 ptIni ptFin desplz desplzX desplzY punto tamTX gapTX gapAcot desplzMax osmant ang ) (setq n 0 osmant (getvar "OSMODE") ) (setvar "OSMODE" 0) (if (setq conj (ssget '((0 . "DIMEN*")))) (progn (while (setq ent (ssname conj n)) (setq pt1 (cdr (assoc 13 (setq lstent (entget ent)))) pt2 (cdr (assoc 14 lstent)) gapAcot (distance pt2 (cdr (assoc 10 lstent))) ang (angle pt2 (cdr (assoc 10 lstent))) tamTX (vlax-get-property (vlax-ename->vla-object ent) "TextHeight" ) gapTX (vlax-get-property (vlax-ename->vla-object ent) "TextGap" ) desplz (+ tamTX gapTX gapAcot) ) (if desplzMax (setq desplzMax (max desplzMax desplz)) (setq desplzMax desplz) ) (if (< (car pt2) (car pt1)) (setq pt pt1 pt1 pt2 pt2 pt ) (if (= (car pt2) (car pt1)) (if (< (cadr pt2) (cadr pt1)) (setq pt pt1 pt1 pt2 pt2 pt ) ) ) ) (if ptIni (if (and (/= (car pt2) (car pt1)) (< (car pt1) (car ptIni)) ) (setq ptIni pt1) (if (= (car pt1) (car pt2)) (if (< (cadr pt1) (cadr ptIni)) (setq ptIni pt1) ) ) ) (setq ptIni pt1) ) (if ptFin (if (and (/= (car pt2) (car pt1)) (> (car pt2) (car ptFin)) ) (setq ptFin pt2) (if (= (car pt2) (car pt2)) (if (> (cadr pt2) (cadr ptFin)) (setq ptFin pt2) ) ) ) (setq ptFin pt2) ) (setq n (+ n 1)) ) (setq punto (polar ptIni (angle ptIni ptFin) (/ (distance ptIni ptFin) 2.0) ) punto (polar punto ang (* desplzMax 1.5)) ) (vl-cmdf "_dimaligned" ptIni ptFin punto) (setvar "OSMODE" osmant) ) ) (princ) )
    1 point
×
×
  • Create New...