Thanks for posting a link to the original discussion. That could have been helpful in this thread, however, the issues remain regarding the running osnaps.
|
Thanks for posting a link to the original discussion. That could have been helpful in this thread, however, the issues remain regarding the running osnaps.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
Modified version any direction curves or lines with Tilde scaled to Current Annotation Scale:
Code:; http://forums.augi.com/showthread.php?171905-Line-Cut-with-Symbol-(Tilde)&p=1336016#post1336016 ;^C^C^P(or C:tildebreak (load "tildebreak.lsp"));tildebreak ;(load "tildebreak.lsp") tildebreak ; (defun c:tildebreak (/ vars *error* p1 p2 InsScale ss obj) (setq vars (mapcar '(lambda (x) (cons x (getvar x))) '("osmode" "nomutt"))) (defun *error* (msg) ;; Reset variables (mapcar '(lambda (x) (setvar (car x) (cdr x))) vars) (grtext -1 "") ;CLEAR STATUS LINE (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\nError: " msg)) (princ) ) ) (setvar 'osmode 512) (setq p1(getpoint "\nFirst breakpoint: ") p2 (getpoint "\nSecond breakpoint: ") ss (ssget p1) obj (vlax-ename->vla-object (ssname ss 0)) ang1 (/(*(angle '(0. 0. 0.) (vlax-curve-getFirstDeriv obj (vlax-curve-getParamAtPoint obj p1)))180)pi) ang2 (- ang1 180) ) (cond ((= 1 (getvar "cvport"))(setq InsScale 1.0)) ((= 1 (getvar "TILEMODE"))(setq InsScale (/ 1 (getvar 'cannoscalevalue)))) (T(setq InsScale (caddr (trans '(0 0 1) 3 2)))) ) (setvar "nomutt" 1) (command "_break" ss p1 p2 "_-insert" "Tilde" p1 InsScale ang1 "_-insert" "Tilde" p2 InsScale ang2 "_regen") (entupd (ssname ss 0)) (mapcar '(lambda (x) (setvar (car x) (cdr x))) vars) (princ) )
Last edited by Tom Beauford; 2018-06-05 at 12:37 PM. Reason: Cleaned up.
Another option:Code:;======================================================= ;Draw Line with Breakline Symbol to Dimscale Updated 6/2018 ; Replacement for BREAKLINE (Express Tool) that works in any direction and scales to Annotation Scale. ;^C^C^P(or C:br (load "br.lsp"));br ; (load "br.lsp") br ; ;======================================================= (defun c:br (/ *error* p1 p2 p3 p4 p5) (setq vars (mapcar '(lambda (x) (cons x (getvar x))) '("osmode" "nomutt"))) (defun *error* (msg) ;; Reset variables (mapcar '(lambda (x) (setvar (car x) (cdr x))) vars) (grtext -1 "") ;CLEAR STATUS LINE (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\nError: " msg)) (princ) ) ) (setvar 'osmode 512) (cond ((= 1 (getvar "cvport"))(setq InsScale 0.1)) ((= 1 (getvar "TILEMODE"))(setq InsScale (/ 0.1 (getvar 'cannoscalevalue)))) (T(setq InsScale (caddr (trans '(0 0 0.1) 3 2)))) ) (setq p3 (getpoint "\nBreak Point: ") ss (ssget p3) obj (vlax-ename->vla-object (ssname ss 0)) ang (angle '(0. 0. 0.) (vlax-curve-getFirstDeriv obj (vlax-curve-getParamAtPoint obj p3))) p1 (polar p3 ang InsScale) p2 (polar p3 (+ (/ pi 3) ang) InsScale) p4 (polar p3 (+ (/ pi 3) (- ang pi)) InsScale) p5 (polar p3 (- ang pi) InsScale) ) (setvar "nomutt" 1) (command "_break" ss p1 p5 "pline" p1 p2 p3 p4 p5 "") (entupd (ssname ss 0)) (mapcar '(lambda (x) (setvar (car x) (cdr x))) vars) (princ) )
Last edited by Tom Beauford; 2018-06-05 at 12:38 PM. Reason: Localized the variables, cleaned it up & reset osmode system variable. Thanks Opie, kinda threw that up too quickly.
Tom,
Are you going to localize your variables to the c:br routine? Looks like you initially did that, but made them global for testing purposes.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt