Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/20/2021 in all areas

  1. I see that and just append the lst for the endpoints. I think we posted with in mins of each other. Its cool to see these do the same thing. (mapcar '(lambda (x) (entmake (list '(0 . "POINT") (cons 10 x)))) intList) (foreach PT lst (entmake (list (cons 0 "POINT") (cons 10 PT) ) ) ) Also how they get the endpoints is better.
    2 points
  2. Thanks Steven, finally finished my lisp and it's working, now does anyone have a better idea to improve it? ;;; By Isaac A. ;;; Select multiples texts and copy their content to nearest texts ;;; https://www.cadtutor.net/forum/topic/74035-copy-multiple-text-contents-to-nearest-text-multiples/ (defun c:cmt (/ cnt1 cnt2 dist ent1 ent2 ss1 ss2 stx1 stx2 tx1 tx2 lyr1 lyr2) (setvar "cmdecho" 0) (vl-cmdf "_.undo" "_begin") (setq *osmode (getvar "osmode")) (setvar "osmode" 0) (setq ss1 (ssget "_X" '((0 . "TEXT") (8 . "cvl_ras_tx"))) ss2 (ssget "_X" '((0 . "TEXT") (8 . "urb_rasante"))) ) (setq cnt1 0) (while (< cnt1 (sslength ss1)) (if (/= nil (assoc 11 (entget (ssname ss1 cnt1)))) (setq pt1 (cdr (assoc 11 (entget (ssname ss1 cnt1)))) cnt2 0 ent1 (entget (ssname ss1 cnt1)) tx1 (assoc 1 ent1) dist 2 ) (setq pt1 (cdr (assoc 10 (entget (ssname ss1 cnt1)))) cnt2 0 ent1 (entget (ssname ss1 cnt1)) tx1 (assoc 1 ent1) dist 2 ) ) (while (< cnt2 (sslength ss2)) (if (/= nil (assoc 11 (entget (ssname ss2 cnt2)))) (setq pt2 (cdr (assoc 11 (entget (ssname ss2 cnt2)))) ) (setq pt2 (cdr (assoc 10 (entget (ssname ss2 cnt2)))) ) ) (if (< (distance pt1 pt2) dist) (progn (setq dist (distance pt1 pt2) ent2 (entget (ssname ss2 cnt2)) tx2 (assoc 1 ent2) ) (entmod (subst tx1 tx2 ent2)) ) ) (setq cnt2 (1+ cnt2)) ) (setq cnt1 (1+ cnt1)) ) (setvar "osmode" *osmode) (vl-cmdf "_.undo" "_end") (princ) )
    1 point
  3. No, there isn't any logic behind it. It's because I'm working with other third parties, and they may have all sorts of different naming system. Just to give a background, I work where third parties extract families from Revit and export them into AutoCAD as blocks. As an example, one of my jobs is to have a certain block (of my own) placed on the insertion point of many other blocks (with the similar names). It makes the whole process easier if I can just ssget based on their names if they are exactly the same blocks, but as you move on from project to project, it's just impossible to find a fixed naming system, but surprisingly their names are always very similar regardless. So my idea was to create a command where I prompt the user to select any two of the desired blocks first, get this string matching pattern, and then integrate this in ssget or wcmatch filtering operations to be able to select the entire drawing. It may not get 100% of it, but at least it can cut the work by getting 85% done. Thanks a lot Marko! It works great. I'll have to study this.
    1 point
  4. update @Trudy's code. Added so Arcs and Polylines can be selected. had to replace (vlax-get x 'EndPoint) with (vlax-curve-getEndPoint x) would error on polylines. Also I don't know if their will be an intersection point if 2 3d polylines cross but they are at different elevations. (defun c:try1 (/ sel sel1 intList typ) (setq sel (ssget '((0 . "ARC,LINE,*POLYLINE")))) (setq sel1 (VaniVL sel "Trudy")) (if sel (setq intList (LM:intersectionsinset sel)) ) (vlax-for x sel1 (setq intList (append intList (list (vlax-curve-getStartPoint x) (vlax-curve-getEndPoint x)))) ) (setq intList (T:filer intList)) (mapcar '(lambda (x) (entmake (list '(0 . "POINT") (cons 10 x)))) intList) (princ) )
    1 point
  5. It's alright to copy other's code into yours, as long as you reference that it's theirs and not yours. It's the typical with copying Lee's subfunctions too.
    0 points
×
×
  • Create New...