Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2023 in all areas

  1. Another. (mapcar '(lambda (j) (setq r nil) (mapcar '(lambda (k) (and (= (car j) (car k)) (setq r (cons (cadr j) r) r (cons (cadr k) r) ) ) ) lst2 ) (setq l (cons (if r (cons (car j) r) (list (car j) 0 (cadr j))) l)) ) lst1 ) (reverse l)
    2 points
  2. (defun foo ( l m ) (mapcar '(lambda ( x ) (list (car x) (cond ((cadr (assoc (car x) m))) (0)) (cadr x))) l) ) _$ (foo lst1 lst2) (("H608" 30 32) ("H609" 24 32) ("H610" 21 32) ("H611" 0 32) ("H612" 20 32) ("H613" 25 32) ("H614" 22 32))
    1 point
  3. (defun c:evenpoly () (princ "\n get polyline's even line : ") (@evenoddpoly 0) ) (defun c:oddpoly () (princ "\n get polyline's odd line : ") (@evenoddpoly 1) ) (defun @evenoddpoly ( evenodd / ss ssl index ent entl ptlist isclosed ptlen 1pt 2pt ) (defun LWPolybyList (lst cls) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length lst)) (cons 70 cls) ) (mapcar (function (lambda (p) (cons 10 p))) lst) ) ) ) ;;;Michal Puckett (defun cdrs (key lst / pair rtn) (while (setq pair (assoc key lst)) (setq rtn (cons (cdr pair) rtn) lst (cdr (member pair lst)) ) ) (reverse rtn) ) (setq ss (ssget '((0 . "LWPOLYLINE")))) (setq ssl (sslength ss)) (setq index 0) (setq ss2 (ssadd)) (repeat ssl (setq ent (ssname ss index)) (setq entl (entget ent)) (setq ptlist (cdrs 10 entl)) (setq isclosed (cdr (assoc 70 entl))) (if (= isclosed 1) (progn (setq ptlist (cons (car ptlist) (reverse ptlist))) (setq ptlist (reverse ptlist)) ) ) (if (= evenodd 1) ;if odd selected (setq ptlist (cdr ptlist)) ;get rid of first vertice ) (setq ptlen (length ptlist)) (if (= (rem ptlen 2) 1) (setq ptlen (- ptlen 1)) ;if ptlist is odd ) (setq index2 0) (repeat (/ ptlen 2) (setq 1pt (nth index2 ptlist)) (setq 2pt (nth (+ index2 1) ptlist)) (setq newpl (LWPolybyList (list 1pt 2pt) 0)) (ssadd newpl ss2) (setq index2 (+ index2 2)) ) (setq index (+ index 1)) ) (sssetfirst nil ss2) (princ) )
    1 point
  4. Why not use Wblock and file rename ?
    1 point
  5. Hi Guys, thanks for such a quick repsonse and explaination. Yes i agree its one of those process that i need to master but it will take a while as i'm at the point where i can confidentely model all the detail i want but i'm having issues conveying the detail in paper space without it massivly slowing down my process. I have attached a couple of screen shots to show my 3d model in model space then how i current take flatshots of the 3d model in model space and then view the 2d lines from paper space. So all my current annotations and dims etc are in model space and i just use paper space for a view but i would like to migrate so all my dims and text are scales to paper space and i just can punch into the model and grab views if that makes sense? As my drawing tend to have several components i was cautious of hiding a counter for example to islote it and then it disappearing on another page as a full drawing pack tends to have around 10 layout pages.
    1 point
  6. Ronjons method works very well if all the text is the same type, mtext, dtext or whatever - otherwise, just need to select the type at the top of the properties dialogue and do it twice. A lot quicker than writing, debugging, and checking a LISP Not sure what is faster to use, since you are selecting the texts and writing in what it is to be, not a lot in it with using a LISP or doing it via properties, think properties method wins. below is my option, also works on Dimensions (and maybe tables but they annoy me so I try not to use them). A bit longer than the others, it is made up from building blocks of my text LISPS... so long winded for this but elsewhere does other stuff. Command txtchange. There is a second defun textchange (without the C:), if you call that from another LISP you can get that LISP to work out the text to use and then update the selected text (for example, 'today', my LISP uses this to put todays date into that text string (defun getent ( aprompt / enta entb pt ) (princ "\n") (setq enta (car (nentsel aprompt))) (setq pt (cdr (assoc 10 (entget enta))) ) (setq entb (last (last (nentselp pt)))) ;;fix for nenset or entsel requirements (if (and (/= entb nil) (/= (type entb) 'real) ) (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION")(setq enta entb)) ) enta ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun addinnewtext (newtext newentlist newent / ) (if (/= newtext nil) (progn (if (= (cdr (assoc 0 newentlist)) "DIMENSION") (progn (entmod (setq newentlist (subst (cons 1 newtext) (assoc 1 newentlist) newentlist))) (entupd newent) );end progn (progn (vla-put-textstring (vlax-ename->vla-object newent) newtext) ;;vla-put-text string for large text blocks + 2000 characters? );end progn ) ;end if ) ;end progn (princ "\nSource text is not 'text'") );end if ) (defun c:txtchange ( / texta) (setq texta (getstring t "\nEnter New Text : ") ) (while (setq ent1 (getent "\nSelect Text (or escape): ")) (txtchange texta ent1) );end while (princ) ) (defun txtchange ( texta ent1 / ) (setq entlist1 (entget ent1)) ;; (setq entcodes1 (list 3 4 1 172 304) ) ;list of ent codes containing text. Don't think I use this here ;; (if (= (cdr (assoc 0 entlist1)) "DIMENSION") (setq entcodes1 (list 4 1 42 172 304))) ;;if dimension. Don't think I use this here (addinnewtext texta entlist1 ent1) (command "redraw") (command "regen") ;;update it all )
    1 point
  7. @ronjonp is right tho. it will just display as * if text is different. if you enter anything and hit enter they will all be changed.
    1 point
  8. Code is not needed for this. Select all the text you want to change then update the contents in the properties palette (CNTRL+1).
    1 point
×
×
  • Create New...