0 Members and 1 Guest are viewing this topic.
c#(defun c:ccdtoleranceDisplay (/ DT ENT ID SDT) (setq dt (ssget '((0 . "DIMENSION"))) sdt (sslength dt) id 0 ) ;_ end of setq (repeat sdt (progn (setq ent (ssname dt id) id (1+ id) ) ;_ end of setq (vlax-put-property (vlax-ename->vla-object ent) 'toleranceDisplay 4 ) ;_ end of vlax-put-property ) ;_ end of progn ) ;_ end of repeat (princ)) ;_ end of defun;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq obj (vlax-ename->vla-object (car (entsel "Pick dim to remove tolerance "))))(vla-put-tolerancedisplay obj 0)
Unless I've misunderstood, something like this?Code - Auto/Visual Lisp: [Select](defun getdimtext ( ent / blk btr enx rtn ) (if (and (setq enx (entget ent)) (setq blk (cdr (assoc 2 enx))) (setq btr (tblobjname "block" blk)) ) (while (and (setq btr (entnext btr)) (not rtn)) (if (= "MTEXT" (cdr (assoc 0 (setq enx (entget btr))))) (setq rtn (cdr (assoc 1 enx))) ) ) ) rtn)
You mean something like this - look at picture and DWG... I just changed height of tolerances from 1.0 to 0.5...
You can add the rest of code required.Code: [Select](setq obj (vlax-ename->vla-object (car (entsel "Pick dim to remove tolerance "))))(vla-put-tolerancedisplay obj 0)
Quote from: BIGAL on October 22, 2023, 06:32:04 PMYou can add the rest of code required.Code: [Select](setq obj (vlax-ename->vla-object (car (entsel "Pick dim to remove tolerance "))))(vla-put-tolerancedisplay obj 0)Isn't this what you want... BIGAL already answered...
To change dimstyle to one with text frame you have to change DXF 147 code from this example to negative value and to remove deviations you'll have to remove rest of MTEXT in DXF 1 code... Something like this example, but if you want to do this fast I don't see why not just using (MA) - matchprop like you described... Anyway, there is no system variable for frame like DIM*...Code - Auto/Visual Lisp: [Select](defun c:tt ( / *error* s i e o ox ) (or (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-get-acad-object) nil))) (vl-load-com)) (defun *error* ( m ) (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewport) (if m (prompt m)) (princ) ) (prompt "\nSelect DIMENSION entities...") (setq s (ssget "_:L" (list (cons 0 "DIMENSION")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (cond ( (= (vla-get-tolerancedisplay (setq o (vlax-ename->vla-object e))) 0) (vla-put-tolerancedisplay o 4) (setq ox (entget (tblobjname "dimstyle" (cdr (assoc 3 (entget e)))) (list "*"))) (if (> (cdr (assoc 147 ox)) 0) (entupd (cdr (assoc -1 (entmod (subst (cons 147 (- 0 (cdr (assoc 147 ox)))) (assoc 147 ox) ox))))) ) ) ( (= (vla-get-tolerancedisplay o) 4) (vla-put-tolerancedisplay o 0) (setq ox (entget (tblobjname "dimstyle" (cdr (assoc 3 (entget e)))) (list "*"))) (if (< (cdr (assoc 147 ox)) 0) (entupd (cdr (assoc -1 (entmod (subst (cons 147 (abs (cdr (assoc 147 ox)))) (assoc 147 ox) ox))))) ) ) ) (entupd e) ) (*error* nil))