Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/01/2023 in all areas

  1. If the R value of the inner and outer lines is the same, it's width is different in curve. Is it sure that picture you want? if YES, and T is smaller than R, you can use this routine. 1. set global width of polyline to T, by properties window (ctrl+1) 2. get outline of polylines by MPOLYOUTLINE http://www.lee-mac.com/polyoutline.html 3. make fillet in once by FMP. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166/highlight/true#M343470 if NO, 1. set global width of polyline to T, by properties window (ctrl+1) 2. make fillet in once by FMP. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166/highlight/true#M343470 3. get outline of polylines by MPOLYOUTLINE. (link is different from the one above.) http://www.lee-mac.com/advpolyoutline.html It is more advanced version of MPOLYOUTLINE, because it recognizes arcs, but it is difficult to execute on complex drawings. so before execution, the drawing must be simply organized.
    3 points
  2. @mousho The 2nd option worked fine for me. It has to be the 2nd version because you MUST use the "\\" to create the single "\" in the actual shell command. Make sure the path exists and everything is spelled correctly. I used the following in my test: (command "_.Shell" (strcat "sort /+8 <" "C:\\Temp\\mpdlist.txt" ">" "C:\\Temp\\newlist.txt")) Results: %%17410 1L=520 2 1 1398 %%17410 2L=747 2 1 1398 %%17410 3L=1198 2 1 1398 %%174 8 4L=954 2 1 1398 %%174 8 5L=520 2 1 1398 %%17410 6L=520 14 15 200399 %%17412 7L=747 14 15 200399 %%17412 8L=1198 14 15 200399 %%174 8 9L=954 14 15 200399 %%174 8 10L=520 14 15 200399
    1 point
  3. I forgot all about fixing this, thanks!
    1 point
  4. Yes - for every yellow segment, you can test whether the segment is collinear with a red segment and if so, whether the extents of both segments is less than the sum of their individual lengths (i.e. testing that they overlap).
    1 point
  5. (setq str (getpropertyvalue (car blklist) "POINT")); the first one this returns the attribute value with the tag name matching "POINT" (setq str (strcat str " - " (getpropertyvalue blk "POINT"))) this returns the attribute value with the tag name matching "POINT" So this is a simple defun that replaces your getproperty of a attribute. save it at start of code. (defun aH:getatt (blk tagn) (foreach att (vlax-invoke (vlax-ename->vla-object blk) 'getattributes) (if (= (vla-get-tagstring att) tagn) (setq str (vla-get-textstring att)) ) ) (princ) ) (ah:getatt (car blklist) "POINT")) ; the first one (setq str (strcat str " - " (ah:getatt blk "POINT")))
    1 point
  6. Just updating what I have above to be a bit more specific - not sure if it will be any different just now though - it should do the same as before. Ignore the rectangle part, it does nothing yet, just thinking ahead to the next steps (defun c:selsimilar ( / MyEnt MySSList) (setq MyEntity (car (entsel "\nSelect an entity in the symbol: "))) (setq pt1 (getpoint "Select Symbol Objects")) (command "Rectangle" Pt1 pause) ;;come back to this line when I remember variable for last mouse clicked point (entdel (entlast)) (if (= MyEntity nil) (princ "\nNothing Selected") (progn (setq MyEnt (entget MyEntity)) ;;Get entity definition to identify objects: ;;Basic Entity Definitions - Line + all below (setq MyEnt0 (assoc 0 MyEnt)) (setq MyEnt67 (assoc 67 MyEnt)) (setq MyEnt8 (assoc 8 MyEnt)) (setq MyEnt62 (assoc 62 MyEnt)) ;;Polyline (setq MyEnt90 (assoc 90 MyEnt)) (setq MyEnt70 (assoc 70 MyEnt)) ;;+ hatch + block (setq MyEnt43 (assoc 43 MyEnt)) (setq MyEnt38 (assoc 38 MyEnt)) (setq MyEnt39 (assoc 39 MyEnt)) ;;Circle, ellipse (setq MyEnt40 (assoc 40 MyEnt)) ;;Ellipse, block (setq MyEnt41 (assoc 41 MyEnt)) (setq MyEnt42 (assoc 42 MyEnt)) ;;Arc (setq MyEnt50 (assoc 50 MyEnt)) (setq MyEnt51 (assoc 51 MyEnt)) ;;Hatch, block (setq MyEnt2 (assoc 2 MyEnt)) (setq MyEnt71 (assoc 71 MyEnt)) ;;Hatch only (setq MyEnt91 (assoc 91 MyEnt)) (setq MyEnt92 (assoc 92 MyEnt)) (setq MyEnt93 (assoc 93 MyEnt)) ;;Create a list to select identical entities (setq MySSList (list MyEnt0 MyEnt67 MyEnt8)) (if (= MyEnt2 nil)()(setq MySSList (cons MyEnt2 MySSList )) ) (if (= MyEnt38 nil)()(setq MySSList (cons MyEnt38 MySSList )) ) (if (= MyEnt39 nil)()(setq MySSList (cons MyEnt39 MySSList )) ) (if (= MyEnt40 nil)()(setq MySSList (cons MyEnt40 MySSList )) ) (if (= MyEnt41 nil)()(setq MySSList (cons MyEnt41 MySSList )) ) (if (= MyEnt42 nil)()(setq MySSList (cons MyEnt42 MySSList )) ) (if (= MyEnt43 nil)()(setq MySSList (cons MyEnt43 MySSList )) ) (if (= MyEnt50 nil)()(setq MySSList (cons MyEnt50 MySSList )) ) (if (= MyEnt51 nil)()(setq MySSList (cons MyEnt51 MySSList )) ) (if (= MyEnt62 nil) (setq MySSList (cons (cons 62 256) MySSList )) (setq MySSList (cons MyEnt62 MySSList )) ) (if (= MyEnt70 nil)()(setq MySSList (cons MyEnt70 MySSList )) ) (if (= MyEnt71 nil)()(setq MySSList (cons MyEnt71 MySSList )) ) (if (= MyEnt90 nil)()(setq MySSList (cons MyEnt90 MySSList )) ) (if (= MyEnt91 nil)()(setq MySSList (cons MyEnt91 MySSList )) ) (if (= MyEnt92 nil)()(setq MySSList (cons MyEnt92 MySSList )) ) (if (= MyEnt93 nil)()(setq MySSList (cons MyEnt93 MySSList )) ) (princ "\Thanks. Analysed sample entity. Now to select the rest. ") (setq MySS (ssget MySSList)) ) ; end prgn ) ; end if (princ "\n")(princ (sslength MySS))(princ " similar entities") (princ) )
    1 point
  7. Will work on text and mtext. ;;----------------------------------------------------------------------------;; ;; Select text to replace (defun C:Sel2Replace (/ SS str) (vl-load-com) (prompt "\nSelect Text") (setq ss (ssget '((0 . "*TEXT"))) newstr (getstring t "\nNew Text: ") ) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (vla-put-textstring (vlax-ename->vla-object ent) newstr) ) ) Shouldn't have got that coffee! @Emmanuel Delay
    1 point
  8. Sure. Like this? Command RMT. It also works for TEXT objects. If you don't want this, replace (cons 0 "TEXT,MTEXT") by (cons 0 "MTEXT") (vl-load-com) ;; RMT for Replace Mtext (defun c:rmt ( / ss newtext i) (princ "\nSelect TEXT/MTEXT elements: ") (setq ss (ssget (list (cons 0 "TEXT,MTEXT") ))) (setq newtext (getstring "\nNew text: " 1)) (setq i 0) (repeat (sslength ss) (vla-put-textstring (vlax-ename->vla-object (ssname ss i)) newtext) (setq i(+ i 1)) ) (princ) )
    1 point
×
×
  • Create New...