Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/09/2026 in Posts

  1. I've used this for years: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-replace-text/td-p/5649883 and some discussion here: https://www.cadtutor.net/forum/topic/92643-batch-find-and-replace/ Noting that the slowest part of any LISP is usually the user interfacing with the software, Looks a nice interface. Without the dialogues of course, you can gain an efficiency with batching a series of drawings
    1 point
  2. Whatever store there is on the internet will suffer similarly from Al generated code, a store where code is uploaded quickly will just become very large, lose its value when there are too many resources to choose all doing something very similar. I think I prefer the forum format (probably always will do), that in creating an answer to the problems asked there is some peer review going on, explanation as what does what and the ability to ask for explanations or how to modify a code supplied to a more unique solution - which is all in itself a great learnign tool
    1 point
  3. Just putting this up here as something I wanted for a while and had 10 minutes to think last night. I'd been wanting a routine "Select an entity or enter a value". Been doing it with initget which gives discrete values and not every possibility. So made up the following. All good so far, haven't found out where it is broken yet. Just to get your brains working then, trying to figure out how to change the mouse pointer as it hovers over an entity and not select it? Using grread and it's options you either get mouse pointer change and it selects automatically or no mouse pointer change and select with a mouse click as far as I can see. Any ideas? Thanks (defun c:EntOrValue ( / msg MyResult) (setq msg "\nSelect an Entity or enter a value: \n") (setq MyResult (EntorValue msg) ) ; end defun ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun EntorValue ( MSG / EndLoop sel MyEnt MyValue enta entb pt) (setq MyValue "") (setq MyEnt (list)) (setq EndLoop "No") (princ MSG) (while (= EndLoop "No") ; start loop (setq sel (nth 1 (grread nil 0 2))) ; read keyboard / mouse inputs. Ignore mouse position, only if clicked (if (= (type sel) 'LIST) (progn ; if sel is a LIST,... ie. a mouse click, a point returned (setq MyEnt (nentselp sel)) ; select entity from point (if (= nil MyEnt) (Princ "\nMissed! Try again. Select text or enter a value: ") ; entity not selected (setq EndLoop "Yes") ; entity selected, end while loop ) ; end if ) ; end progn (progn ; if sel is not a LIST, i.e. a single keyboard entry (if (or (and (> sel 47)(< sel 57))(= sel 46)) ; numbers only (progn (princ (chr sel)) (setq MyValue (strcat MyValue (chr sel) )) ) ) (if (= sel 45) ; -ve ; make negative number (progn (setq MyValue (strcat (chr sel) MyValue )) (princ " Making -ve\n")(princ MyValue) ) ; end progn ) ; end if (if (= sel 13) ; enter - end number input, end loop (progn (setq EndLoop "Yes") ) ; end progn ) ; end if ) ; end progn ) ; end if list ) ; end while (if ( = (length MyEnt) 0) ; if entity not selected (progn MyValue ; return number entered ) ; end progn (progn ;;GetEnt code (setq enta (car MyEnt)) (setq pt (cdr (assoc 10 (entget enta))) ) ;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) ;; use sel? (if (and (/= entb nil) (/= (type entb) 'real) ) (progn (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER")(setq enta entb)) ) ) (setq MyEnt enta) MyEnt ; return entity name, including nested say text from dimensions ) ; end progn ) ; end if )
    1 point
×
×
  • Create New...