Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/01/2021 in all areas

  1. Change this number whatever you need in the code. (setq a 0.125) Alternatively if you use dimscale for scaling: (setq a (if (= 0 (getvar 'dimscale)) 0.125 (* 0.125 (getvar 'dimscale)) ) ) Or if you want to go the mask route with a block: (defun c:hops (/ a b e pts s x) ;; RJP » 2019-01-21 ;; Creates hops on a selection of intersecting polylines (setq a 0.125) (setq a (if (= 0 (getvar 'dimscale)) a (* a (getvar 'dimscale)) ) ) (cond ((null (tblobjname "block" "RJP_WipeOut")) (entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference") (2 . "RJP_WipeOut") (10 0. 0. 0.) (70 . 0) ) ) (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (62 . 7) (420 . 16777215) (100 . "AcDbPolyline") (90 . 2) (70 . 129) (43 . 0.5) (38 . 0.) (39 . 0.) (10 -0.25 0.) (40 . 0.5) (41 . 0.5) (42 . 1.) (91 . 0) (10 0.25 0.) (40 . 0.5) (41 . 0.5) (42 . 1.) (91 . 0) ) ) (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0"))) ) ) (cond ((and (setq s (ssget ":L" '((0 . "lwpolyline")))) (> (sslength s) 1) (setq s (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))))) (setq b s) ) (foreach e s (if (setq pts (apply 'append (mapcar '(lambda (x) (vlax-invoke e 'intersectwith x acextendnone)) (setq b (cdr b)) ) ) ) (while (caddr pts) (entmake (list '(0 . "INSERT") '(8 . "Mask") '(2 . "RJP_WipeOut") (cons 10 (mapcar '+ pts '(0 0 0))) (cons 41 a) (cons 42 a) (cons 43 a) '(50 . 0.) ) ) (setq pts (cdddr pts)) ) ) ) ) ) (princ) ) (vl-load-com)
    1 point
  2. I can't help you with the coordinates who are in a wrong attribute. For the rest, this works. Command INE. This code assumes the coordinates are always integers. Are they? (vl-load-com) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; http://www.lee-mac.com/attributefunctions.html ;; Get Attribute Value - Lee Mac ;; Returns the value held by the specified tag within the supplied block, if present. ;; blk - [vla] VLA Block Reference Object ;; tag - [str] Attribute TagString ;; Returns: [str] Attribute value, else nil if tag is not found. (defun LM:vl-getattributevalue ( blk tag ) (setq tag (strcase tag)) (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (vla-get-textstring att))) (vlax-invoke blk 'getattributes)) ) ;; Set Attribute Value - Lee Mac ;; Sets the value of the first attribute with the given tag found within the block, if present. ;; blk - [vla] VLA Block Reference Object ;; tag - [str] Attribute TagString ;; val - [str] Attribute Value ;; Returns: [str] Attribute value if successful, else nil. (defun LM:vl-setattributevalue ( blk tag val ) (setq tag (strcase tag)) (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (progn (vla-put-textstring att val) val) ) ) (vlax-invoke blk 'getattributes) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; INcrement East (defun c:ine ( / blk val east i ss) (setq ss (ssget "_X" '((0 . "*INSERT") (66 . 1)))) (setq i 0) (repeat (sslength ss) (setq blk (ssname ss i)) (if (setq val (LM:vl-getattributevalue (vlax-ename->vla-object blk) "EAST_COORD")) ;; value of the attribute. (progn (setq east (substr val 11)) ;; the first 10 characters are fixed. (setq east (+ 2000 (atoi east))) ;; add 2000 (princ east) (LM:vl-setattributevalue (vlax-ename->vla-object blk) "EAST_COORD" (strcat "\U+0412\U+041E\U+0421\U+0422\U+041E\U+041A/E. " (itoa east) )) ;; set it back. hardcode that Russian text ) ) (if (setq val (LM:vl-getattributevalue (vlax-ename->vla-object blk) "CONTVAR2EASTCOORD")) ;; value of the attribute. (progn (setq east (substr val 4)) ;; the first 3 characters are fixed. (setq east (+ 2000 (atoi east))) ;; add 2000 (princ east) (LM:vl-setattributevalue (vlax-ename->vla-object blk) "CONTVAR2EASTCOORD" (strcat "E. " (itoa east) )) ;; set it back. hardcode that Russian text ) ) (setq i (+ i 1)) ) )
    1 point
  3. Try inserting block with wipeout, but send to back using draw order, you may have to draw order the wire 1st, then the block its a sequence thing of draw order, have used on images old with new portion over top. 3 objects.
    1 point
  4. BreakObjects.lsp newest version 2.3 by Charles Alan Butler June 6,2019 at: http://www.theswamp.org/index.php?topic=10370.0
    1 point
  5. Here are a few... Object Break | Lee Mac Programming (lee-mac.com) Automatic Block Break | Lee Mac Programming (lee-mac.com) BreakObjects.lsp
    1 point
  6. Does the AutoCAD Electrical toolset do this? Seems to me it does, I lost the use of mine when they put 32-bit office on my new computer. I need to put in for IT to give me the 64-bit Office so I can go back to using it. I used use a LISP for doing similar in P&IDs, it should be here on CADTutor. I'll see what I can find.
    1 point
  7. 1 point
  8. It does not add any crossing block but as I already mentioned in my previous post that you can BREAK the wire lines although this option is not available in the trial version but in the permanent one.
    1 point
  9. For my architectural lighting / switching plans, I use a block with a masking wipeout between the pair of lines to hide the wire below. Avoids the need to trim.
    1 point
  10. I already have wiring program and used a lot in Electrical field and also have the Break button to break wires based on the length the use specifies. https://autolispprograms.wordpress.com/wiring-program/
    1 point
×
×
  • Create New...