Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2023 in all areas

  1. Was your friend ChatGPT ? "vlax-curve-curve-intersect" is not a native function. This should do what you want: (defun c:foo (/ s s2) ;; RJP » 2023-06-13 (cond ((setq s (ssget '((0 . "HATCH") (410 . "Model")))) (setq s2 (ssget "_X" '((0 . "HATCH") (410 . "Model")))) (foreach e (mapcar 'cadr (ssnamex s2)) (or (ssmemb e s) (entdel e))) ) ) (princ) )
    2 points
  2. Kinda made the same thing that inverts the current selection for things on screen. Useful for when its easier to select the things you don't want vs the things you do. ;;----------------------------------------------------------------------------;; ;; Invert Selection on Screen (defun C:SEE (/ SS SS1) (if (setq SS (ssget "_I")) (progn) (setq ss (ssadd)) ) (if (setq SS1 (ssget "_WP" (GetScreenCoords))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (ssdel ent SS1) ) ) (sssetfirst nil SS1) (princ) ) ;;----------------------------------------------------------------------------;; ;Calculates Size of View Window (defun GetScreenCoords (/ ViwCen ViwDim ViwSiz VptMin VptMax) (setq ViwSiz (/ (getvar 'VIEWSIZE) 2) ViwCen (getvar 'VIEWCTR) ViwDim (list (* ViwSiz (apply '/ (getvar 'SCREENSIZE))) ViwSiz) VptMin (mapcar '- ViwCen ViwDim) VptMax (mapcar '+ ViwCen ViwDim) ) (list VptMin VptMax) )
    1 point
  3. To select xref text, you will want to use nentselp instead of entsel to select the text objects - I am not sure of your ability and if this makes sense ? Try this in a LISP or paste into the command line as an example: (princ (cdr (assoc 1 (entget (car (nentselp "Select text: ")))))) ) Then all you need to do is make a loop to select the texts one after another, and paste them into the block.... To paste to a block how is the LISP to know which text to paste to which attribute? I tend to select each text in a block one after another to update, but to do it with one click you'll maybe need to specify the attribute tag names The rest of what you want should all be copy and paste from somewhere, just need to know how to do pasting to attributes EDIT and a bit long winded way to do it, copy and paste, will select texts (up to something like 255 characters long) until you hit enter or space. Just need to know about the blocks EDIT 2: Added dotted pair list for output, just as an idea for copying / pasting many many texts (either use a foreach loop or an assoc search... not decided yet). Commented that part out for now (defun c:txtmg ( / MyTexts EndLoop MyText acount) (setq MyTexts (list)) (setq EndLoop "No") ;;(setq acount 0) (while (= EndLoop "No") (setq MyText (gettext)) (if (= (type MyText) 'ENAME) (progn ;;(setq acount (+ acount 1)) (setq MyTexts (append MyTexts (list (cdr (assoc 1 (entget Mytext)) ) ) ;;(list (cons acount (cdr (assoc 1 (entget Mytext))) )) )) ; end append, end setq (princ (last MyTexts)) ) ; end progn (progn (setq EndLoop "Yes") ) ) ; end if ) ; end while (princ MyTexts) ) (defun gettext ( / endloop enta entb pt result LP) (setvar "errno" 0) (setq endloop "No") (while (and (= endloop "No")(/= 52 (getvar "errno")) ) (setq LP (getvar "lastpoint")) (setq result (nentselp "\nSelect Text: ")) (cond ((= 'list (type result)) ;;do stuff with ENT (if (not (wcmatch (cdr (assoc 0 (entget (car result)))) "TEXT,MTEXT,ATTRIB") ) (progn (princ "\nThats not Text...\n") ) ; end progn (progn (princ "I thank you, that is selected OK: ") (setq enta (car result)) (setq pt (cdr (assoc 10 (entget enta))) ) ;;;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) (if (and (/= entb nil) (/= (type entb) 'real) ) (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION,*LEADER")(setq enta entb)) ) (setq endloop "Yes") ) ; end progn ) ; end if ) ( (or (= "Exit" result)(= "E" result)) (princ "\n-Cancel or Exit- ") ) ( (= nil result) ;; Missed (if (= LP (getvar "lastpoint"))(princ)(princ (strcat "\nMissed: Select text, do try again. "))); ) (t (setq enta "Ended") (setvar "errno" 52) ) ) ; end conds ) ; end while enta ;;Entity name )
    1 point
  4. I made my living room in natural stone with the Roman opus model. There are several possible models. I made a drawing to help me with the pose, I attach the DXF for example opus romain.dxf
    1 point
  5. Did you try the Bentley forums? I found this on the Bentley Site, Where to customize the List (*.lst) file to print required partlist in ProSteel for AutoCAD? - ProStructures Wiki - ProStructures - Bentley Communities
    1 point
  6. Learning lisp. Start with these sites... AfraLisp http://www.afralisp.net/autolisp/tutorials/the-basics-part-1.php AutoLisp Programming http://ronleigh.com/autolisp/ AutoLisp Crash Course http://www.cad-manager.com/wp-content/uploads/2007/11/cp105-2_the-autolisp-crash-course.pdf AutoLisp Code http://web2.airmail.net/terrycad/AutoLISP-Code.htm CADSoft Solutions - Tutorials http://www.caddsoftsolutions.com/AutoLISP.htm Jeffrey Sanders - AutoLisp http://www.jefferypsanders.com/index.html Lee Mac Programming http://lee-mac.com/ The Swamp http://www.theswamp.org/index.php
    1 point
×
×
  • Create New...