Jump to content

Leaderboard

Popular Content

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

  1. Basic example for you to get start with. (if (setq ss (ssget '((0 . "LINE,POINT")))) (repeat (setq i (sslength ss)) (setq e (entget (ssname ss (setq i (1- i))))) (if (= (cdr (assoc 0 e)) "LINE") ;; then do your stuff here for lines ;; else is point object so do your stuff for points. ) ) )
    2 points
  2. If you draw a pline of picked points and close as normal, then get vertices/co-ordinates you can determine using say pt1 pt2 pt3 angle, is it L or R then label etc the last leg is like angle pt6 pt1 pt2 you should label leg 1-2 need time to think.
    2 points
  3. like this? (defun tmp ( / vl rl) (setq vl '((a b c) (a nil nil) (a nil c))) ;;; -> ((a b c) (a " " " ") (a " " c)) (foreach l vl (setq rl (cons (mapcar '(lambda (x)(if (null x) " " x)) l) rl))) (reverse rl) )
    2 points
  4. Made this for someone a couple of months ago. They would import a satellite photo and they wanted to pick the corners of the house. ;;----------------------------------------------------------------------------;; ;; L Shape House (defun C:LHouse (/ p1 p2 p3 p4 p5 p6) (setq p1 (getpoint "\nPick Point 1") p2 (getpoint "\nPick Point 2") p3 (getpoint "\nPick Point 3") p4 (getpoint "\nPick Point 4") p5 (getpoint "\nPick Point 5") ) (setq p6 (list (car p5) (cadr p1))) (setvar 'cmdecho 0) (command "_.pline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_non" p5 "_non" p6 "_CL") (setvar 'cmdecho 1) (princ) ) Don't know about the L or R's
    2 points
  5. There is better examples of this as many points as you want Close is supported but still need a enter to stop, busy today so sorry no code time. (defun c:plpts ( / pt) (setq pt (getpoint "\nStarting point of Pline : ")) (command-s "_.pline" pt) (while (getpoint "\nPick next pt Enter to stop") ) )
    1 point
  6. You can loop though the selectionset and create two new ones with the items filtered like this. This is only better if you use the whole set later, otherwise its an extra step from the solution Tharwat posted (if (setq ss (ssget '((0 . "LINE,POINT")))) (progn (setq lines (ssadd) ; Create empty selectionset points (ssadd) ; Create empty selectionset counter 0) (repeat (setq i (sslength ss)) ; Loop through selectionset and split into two sets (setq e (ssname ss (setq i (1- i)))) (if (eq (cdr (assoc 0 (entget e))) "LINE") ; Decide which set to add to. (ssadd e lines) (ssadd e points) ) ) (setq ss nil) ; Remove origional set ; So stuff with lines-selectionset and points-selectionset ))
    1 point
  7. Hi For better help Attached example excel file as you say
    1 point
×
×
  • Create New...