Jump to content

Leaderboard

Popular Content

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

  1. output of this routine is selection. so, just add (command "erase" ) before (princ), after ) in the last section
    2 points
  2. Follow AutoCAD guidelines and put your lisp files in a folder in both the Support File Search Path and Trusted folders to minimize the possibility of loading and executing malicious code, always set the TRUSTEDPATHS system variable to unique, read-only folders where your authorized applications are located. Then you never have to put paths in macros again. ^C^C(LOAD "add2block.lsp");add2block would be all you need.
    1 point
  3. Thanks again. I did it that way .-)
    1 point
  4. Reup Ps:Looks like the litle is wrong. There is no arc tangent to 2 arcs R10 and R4 intersecting the line 6mm from the center.
    1 point
  5. If its a dynamic block then it has a length property, I did not open dwg, download Lee-mac dynamic block properties lisp and it has code to get the L=3000, just need to know property name.
    1 point
  6. 1 point
  7. I misunderstood what you where wanting to do. When making the notes saves that view and when opening the file recall the view. (command "-View" "S" "Notes") ;save view locaiton (command "-View" "R" "Notes") ;Restore view locaiton or have them on their own layer. when a drawing is opened zoom to object on that layer. (if (setq SS (ssget "_X" '((0 . "*TEXT") (8 . "Notes")))) (command "_.Zoom" "OB" SS "") (prompt "\nDrawing Notes not found") )
    1 point
  8. Guessing This is on a network drive? run whohas will look for DWL files of the same name. and display user (computer name) and time the file was opened. Some times dwl files don't get deleted when closing. If you dont have whohas this will try an open a file in append mode if it can its not currently open and then will open the drawing on your computer. If it is open it will display an alert message. Set FP to a default location you want to start in like project folder. (defun C:OpenFile (/ FP filename f) (setq FP "C:\\Project folder\\") (setq filename (getfiled "Select Drawing" FP "*" 8)) (if (setq f (open filename "a")) (progn (close f) (command "open" filename "") ) (alert "\nFile Is Already Open") ) ) lightly tested
    1 point
  9. I suggest you just use the code that you have. Let the entire list be printed then just scroll through the text screen. This way you can look at any of the data by moving up and down the list whether or not the information is on "page 1" or "page n".
    1 point
  10. The OP also posted the same question here. It is surprising to see the variety of solutions yielding slightly different shapes that have been offered by experienced user. It's clearly not a well dimensioned drawing!
    1 point
  11. Make sure all layers are on, thawed, and unlocked. run audit then purge. See if you have any nested blocks that have a reference in them. Still there ? might just be easier to start a new drawing and copy things over. with the help of steal
    1 point
  12. Thinking more about this maybe it would be better to let the user decide what to search for. or use both top for common terms and this for not so common terms. You also have to input the * for wild cards and use , if you going to search for more then one term. its also important to note when typing the search terms you can't use spaces. (defun C:selTxt (/ SS txt) (setq txt (getstring "\nSearch Text for Terms: ")) ;hit enter for defult options. (if (eq txt "") (setq txt "Area*,*m2") ;set defult search options here ) (if (setq SS (ssget "_X" (list '(0 . "*TEXT") (cons 1 txt) (cons 410 (getvar 'ctab))))) (sssetfirst nil ss) (prompt (strcat "\nText doesn't contain " txt)) ) (princ) ) Example Search Text for: area*,*m2 This would work like above lisp. Search Text for: *area* This would select text that has the word "area" in it. Search Text for: *door This would select text that ends with "door" Search Text for: area*,*m2,*area*,*door This would select all 3 examples text in one go.
    1 point
  13. This will select/highlight any text that starts with "Area" or ends with "m2". (defun C:seltxt (/ SS) (setq SS (ssget "_X" (list '(0 . "*TEXT") '(1 . "Area*,*m2") (cons 410 (getvar 'ctab))))) (sssetfirst nil ss) (princ) )
    1 point
  14. OK, are you able to share your LISP routine, drag and drop "C:\Users\Utente\Dropbox\Lavoro\backup\AUTOCAD\Lisp\PURGE shape purge.lsp" using the 'drag files' option (bottom left of the message box here), then we can see what it contains and should be able to suggest what you need to do? To me it sounds like AutoCAD is doing what you are asking it to do, but need to ask it a slightly different question, we should be able to help you with that after seeing your LISP file
    1 point
  15. Yes @Steven P probably didn't explain it properly. 1. ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) only loads the lisp. 2. Loading a lisp by default doesn't produce a message by default 3. if you already have the lisp loaded you only need to run the lisp then and should either be typed in the command prompt or ^C^C _lispcommand if you want just upload your lisp file and Steven or I will fix it.
    1 point
  16. Try this: (defun c:foo (/ _getlength e l l2 r s) ;; RJP » 2020-07-09 ;; Select objects with similar length (defun _getlength (e / ep) (if (vl-catch-all-error-p (setq ep (vl-catch-all-apply 'vlax-curve-getendparam (list e)))) 0. (vlax-curve-getdistatparam e ep) ) ) (cond ((and (setq e (car (entsel "\nPick an object to set length filter: "))) (setq s (ssget))) (setq r (ssadd)) (setq l (_getlength e)) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (and (setq l2 (_getlength x)) (equal l l2 1e-4) (ssadd x r)) ) (sssetfirst nil r) ) ) (princ) )
    1 point
×
×
  • Create New...