Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/24/2024 in all areas

  1. Try this, my only comment is if you do not want other lines then erase before running. I have not allowed for removal of unused lines. You need to save Multi Radio buttons.lsp in a support path or change the (load "d:\\full path name here\\Multi radio buttons.lsp") used in flip yes or no. ; https://www.cadtutor.net/forum/topic/94001-lisp-to-draw-arc-between-two-lines/ (defun c:arcfill2 ( / chkends oldsnap rad swap ent1 ent2 start end start2 end1 end2 circ cen) ; By Alanh Nov 2024 (defun chkends (ent / ) (setq pt (cadr ent)) (setq entg (entget (car ent))) (setq obj2 (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj2)) (setq end (vlax-curve-getendPoint obj2)) (setq d1 (distance pt start)) (setq d2 (distance pt end)) (if (> d1 d2) (progn (entmod (subst (cons 10 end)(cons 10 entg) entg)) (entmod (subst (cons 11 start )(cons 11 entg) entg)) (setq swap "Yes") ) ) (princ) ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq rad 5.0) (setq ent1 (entsel "\nPick 1st line near intersection ")) (setq swap "No") (chkends ent1) (if (= swap "Yes") (setq start1 end end1 start) (setq start1 start end1 end) ) (setq newpt1 (polar start1 (angle start1 end1) (/ rad 2.))) (setq ent2 (entsel "\nPick 2nd line near intersection ")) (setq swap "No") (chkends ent2) (if (= swap "Yes") (setq start2 end end2 start) (setq start2 start end2 end) ) (setq newpt2 (polar start2 (angle start2 end2) (/ rad 2.))) (command "circle" start1 rad) (setq circ (entlast)) (setq cen (cdr (assoc 10 (entget circ)))) (command "trim" circ "" newpt1 newpt2 "") (command "erase" circ "") (command "arc" (polar start2 (angle start2 end2) rad) "C" cen (polar start1 (angle start1 end1) rad) ) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "h" '("Flip arc" "Yes" "No"))) (if (= ans "Yes") (progn (command "erase" "last" "") (command "arc" (polar start1 (angle start1 end1) rad) "C" cen (polar start2 (angle start2 end2) rad)) ) ) (setvar 'osmode oldsnap) (princ) ) (c:arcfill2) Multi radio buttons.lsp
    1 point
  2. I would look into doing help style answer, you can open a text file real easy using say notepad, (command "notepad" "d:\\acadtemp\\lsp.txt"), you can open a Word doc similar method, open a movie and more. Just add a defun like mylisphelp, add to a menu I have a word doc containing "how to" its like 29 pages of help. It has images and instructions.
    1 point
  3. The following offers another method using a temporary saved view - the advantage being that the user can adjust the view plane in addition to zooming & panning: (defun c:test ( / *error* doc idx obj vpo vwc vwn ) (defun *error* ( msg ) (if (and (= 'vla-object (type obj)) (vlax-write-enabled-p obj)) (vla-delete obj) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (setq doc (vla-get-activedocument (vlax-get-acad-object)) vwc (vla-get-views doc) idx 0 ) (while (itemp vwc (setq vwn (strcat "$temp" (itoa (setq idx (1+ idx))))))) (setq obj (vla-add vwc vwn) vpo (vla-get-activeviewport doc) ) (foreach prp '(center direction height target width) (vlax-put-property obj prp (vlax-get-property vpo prp)) ) (getpoint "\nPan & zoom around...") (vla-setview vpo obj) (vla-put-activeviewport doc vpo) (*error* nil) (princ) ) (defun itemp ( col key ) (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list col key)))) ) (vl-load-com) (princ)
    1 point
  4. You will only be able to select Primary entities with ssget.
    1 point
×
×
  • Create New...