Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/29/2020 in all areas

  1. IMO geometry algorithm (tips: quadrilateral area) is faster than "guessing", but coding with iteration inters is much easier here i have a simple concept, just pick at one segment leg then slide. the rest you can optimize.. (defun c:aaa ( / ang en i k l p p1 ep ) (and (mapcar 'set '(en p) (entsel "Pick segment on LWPOLYLINE.. ")) (setq p1 (osnap p "nea")) (setq p (trans p1 1 0) i (fix (vlax-curve-getparamatpoint en p))) (setq ep (vlax-curve-getEndParam en)) (>= ep 3) (< 0 i (1- ep)) (setq ang (mapcar ''((x) (angle '(0. 0. 0.) (vlax-curve-getFirstDeriv en x))) (list (1- i) (1+ i)) ) ) (while (and p (mapcar 'set '(k p) (grread t 13)) (= 5 k) (setq p1 (trans p 1 0)) ) (redraw) (setq l (mapcar ''((a b / p) (list (setq p (vlax-curve-getPointAtParam en b)) (inters p (polar p a 1.0) p1 (polar p1 (angle '(0. 0. 0.) (vlax-curve-getFirstDeriv en i)) 1.0 ) nil ) ) ) ang (list i (1+ i)) ) ) (grvecs (apply 'append (mapcar ''((x) (cons (car x) (mapcar ''((x) (trans x 0 1)) (cdr x))) ) (cons (cons 2 (mapcar 'cadr l)) (mapcar ''((x) (cons 2 x)) l ) ) ) ) ) ) ) (princ) )
    2 points
  2. Another: (defun reversesub2 ( l a b / i ) (setq i -1) (mapcar '(lambda ( x ) (if (<= a (setq i (1+ i)) b) (nth (- b i (- a)) l) x)) l) )
    1 point
  3. This should work, select the 'yellow' cells Ctrl+c then in AutoCAD LT make sure the command line is active, the cursor should be blinking in the command line, so you might need to click on the command line a couple of times, then Ctrl+v (if the command line isn't active then AutoCAD will use pasteclip). Hatch.xlsx
    1 point
  4. Matching your sample put this in cell G2 =CONCATENATE("-hatch Properties ",C2," ",D2," ",E2," ",A2,",",B2," ") then copy down for all hatches, then select the cells in column G copy then paste to Autocad command line. hatches should appear.
    1 point
  5. BingoBox finally explained doubt thanks
    1 point
  6. Oddly enough, that's exactly what i use: [ code removed from link ] (defun c:HiLow (/ obj pts) (while (setq obj (Car (entsel))) (progn (vla-getboundingbox (vlax-ename->vla-object obj) 'll 'ur) (setq pts (mapcar '(lambda (p) (vlax-curve-getClosestPointToProjection obj (vlax-safearray->list p) '(1.0 0.0 0.0) ) ) (list ll ur) ) ) ;; for showing the points ;; (Foreach p pts (entmakex (list (cons 0 "POINT") (cons 10 p) ) ) ) ) ) )
    1 point
  7. What about the coordinates of: EDIT: I just realized its too easy for any shape pseudo code --> enclosure+crate+adjacent+extension+horizontal Lisp Code
    1 point
  8. Such solutions will not necessarily yield a point on the polyline.
    1 point
  9. Inside repeat (defun c:demo ( / ss mn mx e _lowY) (if (setq ss (ssget )) (progn (repeat (sslength ss) (cond ((and (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list (vlax-ename->vla-object (setq e (ssname ss 0))) 'mn 'mx)))) (setq mn (vlax-safearray->list mn)) (setq _lowY (if (or (null _lowY) (< (cadr mn )(Cadar _lowY))) (list mn e) _lowY)) ) ) ) (ssdel e ss) )(sssetfirst nil (ssadd (cadr _lowY))) ) ) (princ) ) But thats just me
    1 point
×
×
  • Create New...