Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/14/2021 in all areas

  1. For mtext: ;; Change this (setq ss (ssget '((0 . "*polyline,Line,Text")))) ;; to this (setq ss (ssget '((0 . "*polyline,Line,*Text")))) ;; and this (if (= "TEXT" (cdr (assoc 0 (entget x)))) ;; to this (if (wcmatch (cdr (assoc 0 (entget x))) "*TEXT")
    1 point
  2. For rest opurtonities use this one: (defun c:AboveDimLineREST ( / s i e c10 c11 c13 c14 c100 p11 n11 entity edata) (if (setq s (ssget "_:L" '((0 . "DIMENSION")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (and (mapcar '(lambda (x) (set (read (strcat "c" (itoa x))) (cdr (assoc x (reverse (entget e)))))) '(10 11 13 14 100)) (vl-position c100 '("AcDbAlignedDimension" "AcDbRotatedDimension")) ;; (setq x09 (inters c10 (polar c10 (+ (angle c14 c10) (/ pi 2)) 1) c13 (polar c13 (angle c14 c10) 1) nil)) ;;(if (= c10 x09) ;; (setq x09 (car (- x09 2000)) (cadr (- x09 2000))) (setq entity e) (setq edata (entget entity)) (setq 1st (cdr (assoc 13 edata))) (setq 2nd (cdr (assoc 14 edata))) (setq x09 1st) (setq c10 2nd) (setq p11 (inters c11 (polar c11 (+ (angle x09 c10) (/ pi 2)) 1) x09 c10 nil)) ;;(setq n11 (polar c11 (angle c11 p11) (* 2 (distance c11 p11)))) (setq n11 (polar c11 (angle c11 p11) (* 2 (distance c11 p11)))) ;;(setq n11 (polar c11 (/ 3.1415 2) (* -2 (distance c11 p11)))) ;;changes (progn (if (> (car c11) (car p11)) (not (setpropertyvalue e "TextPosition/X" (car n11))) ) (if (< (cadr c11) (cadr p11)) (not (setpropertyvalue e "TextPosition/Y" (cadr n11)))))) ) ) ;end of changes ;;(command "circle" c11 "100" "") ;;c11 is old dimtext point ;;(command "circle" n11 "200" "") ;;n11 is new dimtext point ;;(command "circle" p11 "300" "") ;;p11 is point on dimline ;;(command "circle" x09 "400" "") ;;x09 is start point of dimline ;;(command "circle" c10 "500" "") ;;c10 is end point (princ) ) NOTE: Use ONLY ON REST OF DIMENSION, which the first lisp doesn't give result
    1 point
  3. Ok, check this one: (defun c:AboveDimLine ( / s i e c10 c11 c13 c14 c100 p11 n11) (if (setq s (ssget "_:L" '((0 . "DIMENSION")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (and (mapcar '(lambda (x) (set (read (strcat "c" (itoa x))) (cdr (assoc x (reverse (entget e)))))) '(10 11 13 14 100)) (vl-position c100 '("AcDbAlignedDimension" "AcDbRotatedDimension")) (setq x09 (inters c10 (polar c10 (+ (angle c14 c10) (/ pi 2)) 1) c13 (polar c13 (angle c14 c10) 1) nil)) (setq p11 (inters c11 (polar c11 (+ (angle x09 c10) (/ pi 2)) 1) x09 c10 nil)) ;;(setq n11 (polar c11 (angle c11 p11) (* 2 (distance c11 p11)))) (setq n11 (polar c11 (angle c11 p11) (* 2 (distance c11 p11)))) ;;(setq n11 (polar c11 (/ 3.1415 2) (* -2 (distance c11 p11)))) ;;changes (progn (if (> (car c11) (car p11)) (not (setpropertyvalue e "TextPosition/X" (car n11))) ) (if (< (cadr c11) (cadr p11)) (not (setpropertyvalue e "TextPosition/Y" (cadr n11)))))) ) ) ;end of changes ;;(command "circle" c11 "400" "") ;;c11 is old dimtext point ;;(command "circle" n11 "400" "") ;;n11 is new dimtext point ;;(command "circle" p11 "400" "") ;;p11 is point on dimline ;;(command "circle" x09 "400" "") ;;x09 is start point of dimline (princ) ) The problem was that i wasn't seeing Your fonts, must change it. The property "above" "under" was changing but the text real position not. Modded the code which was working to check if dim is below line. NOTE: there are still some dimensions for which the code is not working, but the orginal code which You gave also didn't. The problem is in dimensions, becouse the center of dimtext is not parpendicular to dimline center.
    1 point
  4. Correct. It's not backwards compatible and only forward compatible through an upgrade process only.
    1 point
  5. Try this .. it was bonking out because the _aap function was returning nil. (defun c:foo (/ _aap l lines p p2 ss text) ;; RJP - 6.14.2017 (defun _aap (ename pt / param) (if (and (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getendparam (list ename)))) (setq param (vlax-curve-getparamatpoint ename pt)) ) (angle '(0 0) (vlax-curve-getfirstderiv ename param)) ) ) (if (setq ss (ssget '((0 . "*polyline,Line,Text")))) (progn (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (if (= "TEXT" (cdr (assoc 0 (entget x)))) (setq text (cons x text)) (setq lines (cons x lines)) ) ) (if lines (foreach x text (setq p (cdr (assoc 10 (entget x)))) (setq l (mapcar '(lambda (x) (list (setq p2 (vlax-curve-getclosestpointto x p)) (distance p p2) (_aap x p2)) ) lines ) ) (setq l (car (vl-sort l '(lambda (a b) (< (cadr a) (cadr b)))))) ;; Check that we have an angle assigned (if (caddr l) (progn (entmod (subst (cons 50 ((lambda (x) (if (<= (* 0.5 pi) x (* 1.5 pi)) (+ x pi) x ) ) (caddr l) ) ) (assoc 50 (entget x)) (entget x) ) ) ) ) ; <--- Modified by Jonathan Handojo (entmod (subst (cons 10 (car l)) (assoc 10 (entget x)) (entget x))) ; <--- Line added by Jonathan Handojo ) ) ) ) (princ) )
    1 point
  6. Check the AutoDesk Knowledge Network and look for the white paper entitled "Backward compatibility of Revit with earlier releases of software."
    1 point
  7. Don't really understand having a shortcut in the same folder as the file. This will allow you to create a shortcuts. http://www.theswamp.org/index.php?topic=25051.0
    1 point
×
×
  • Create New...