Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/08/2024 in all areas

  1. Just me add do you want to write to Excel also when making table. Attachment big shout out to FIXO who is no longer with us. Just google has great stuff. Alan Excel library.lsp I should post to downloads.
    1 point
  2. Did you google ? Uses sort on Y so knows the order for excel, I think the example code solution was for multi line text and mtext. May have been Forums/Autodesk.
    1 point
  3. Drafting correctly in the 1st place should remove the problems. There is some code out there that looks at miss closes, but its not mine.
    1 point
  4. Look at modification by Lee Mac of the code by David Bethel found here: http://www.cadtutor.net/forum/showthread.php?62556-3D-polyline-Intersection&p=426585&viewfull=1#post426585 P.S. It's very useful to have points on Section for later edit.
    1 point
  5. Lisp inspired from this post Looks like plots how are you determining the correct locations do you have survey information? This creates circles on the vertex of each polyline. then adds them to a selection set. if their is another circle center between a distance of 0.001 to 0.5 it add that circle to another list if not it deletes the circle. this will insure all circles between this distance are left and highlight where the vertex's don't match. Also attached your example drawing with this lisp ran on it. Having a total of 31 problem areas. if you increase the precision of 0.001 it will add more areas. ;;----------------------------------------------------------------------;; ;; ADD CIRCES TO EACH VERTEX OF A POLYLINE THAT DON'T MATCH. (defun C:PPCIR (/ SS S cords d ent a b c) (if (setq SS (ssget '((0 . "*POLYLINE")))) (foreach poly (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq cords (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget poly)))) (foreach pt cords (entmake (list '(0 . "CIRCLE") (cons 10 pt) '(40 . 2) '(8 . "Mark"))) ;creat a circle with a radius of 2 ) ) ) (cond ((setq S (ssget "_X" '((0 . "CIRCLE") (8 . "Mark")))) (foreach ent (mapcar 'cadr (ssnamex S)) (setq a (cons (list (cdr (assoc 10 (entget ent))) ent) a)) ) (while (setq c (car a)) (setq a (cdr a)) (if (or (member t (mapcar '(lambda (x) (and (not (equal (car c) (car x) 0.001)) (<= (distance (car c) (car x)) 0.5))) a)) (member t (mapcar '(lambda (x) (and (not (equal (car c) (car x) 0.001)) (<= (distance (car c) (car x)) 0.5))) b))) (setq b (cons c b)) (entdel (cadr c)) ) ) ) ) (princ) ) Example.dwg
    1 point
  6. Having had a proper look, I must say, great code David, I really like your method: clean and intuitive to follow. I hope you don't mind, I have made some modifications to condense the code and perhaps improve performance: (defun c:Slice3DPoly ( / _FindZOnLine ed en i p1 p2 pl sl ss tp vd vl ) ;; A modification by Lee Mac of the code by David Bethel found here: ;; http://www.cadtutor.net/forum/showthread.php?62556-3D-polyline-Intersection&p=426585&viewfull=1#post426585 (defun _FindZOnLine ( fp p1 p2 ) (cond ( (or (equal p1 p2 1e-11) (equal (caddr p1) (caddr p2) 1e-11) (equal (list (car p1) (cadr p1)) (list (car p2) (cadr p2)) 1e-11) ) (caddr p1) ) ( (+ (caddr p1) (* (- (caddr p2) (caddr p1)) (/ (distance (list (car p1) (cadr p1)) (list (car fp) (cadr fp))) (distance (list (car p1) (cadr p1)) (list (car p2) (cadr p2))) ) ) ) ) ) ) (if (and (setq p1 (getpoint "\nSpecify First Point: ")) (setq p2 (getpoint "\nSpecify Second Point: " p1)) (setq ss (ssget "_F" (list p1 p2) '((0 . "POLYLINE") (-4 . "<NOT") (-4 . "&") (70 . 118) (-4 . "NOT>")))) ) (progn (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i))) ed (entget en) en (entnext en) vd (entget en) vl nil ) (while (eq "VERTEX" (cdr (assoc 0 vd))) (setq vl (cons (cdr (assoc 10 vd)) vl) en (entnext en) vd (entget en) ) ) (if (= 1 (logand 1 (cdr (assoc 70 ed)))) (setq sl (cons (mapcar 'list vl (append (cdr vl) (list (car vl)))) sl)) (setq sl (cons (mapcar 'list vl (cdr vl)) sl)) ) ) (foreach s (apply 'append sl) (if (setq tp (inters p1 p2 (list (caar s) (cadar s)) (list (caadr s) (cadadr s)) ) ) (setq pl (cons (list (car tp) (cadr tp) (_FindZOnLine tp (car s) (cadr s))) pl)) ) ) (entmakex '((0 . "POLYLINE") (10 0.0 0.0 0.0) (70 . 8))) (foreach x (vl-sort pl (function (lambda ( a b ) (< (distance p1 (list (car a) (cadr a))) (distance p1 (list (car b) (cadr b))) ) ) ) ) (entmakex (list '(0 . "VERTEX") (cons 10 x) '(70 . 32))) ) (entmakex '((0 . "SEQEND"))) ) ) (princ) ) (vl-load-com) (princ)
    1 point
  7. A while statement would be what you want... (defun c:BND (/ pt) (while (setq pt (getpoint "\nPick internal point: ")) (command "_.-boundary" "_a" "_i" "_n" "" "" "_non" pt "") ) (princ) )
    1 point
×
×
  • Create New...