Irem Kocabas Posted September 10 Share Posted September 10 Hello everyone. I don't know how to do Lisp so I wanted to consult you. I use a lisp called ColorX that literally saved my life. Is there a version of this lisp that works with linetype logic? Quote Link to comment Share on other sites More sharing options...
Steven P Posted September 10 Share Posted September 10 There are many LISPs out there and many versions of them, are you able to post the ColorX lisp or a link to it so we know what it does? Quote Link to comment Share on other sites More sharing options...
Irem Kocabas Posted September 10 Author Share Posted September 10 Of course, I am sending it in attachment. colorx.lsp Quote Link to comment Share on other sites More sharing options...
Saxlle Posted September 10 Share Posted September 10 Hi, Can you post a dwg or an example file? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 10 Share Posted September 10 Why don't you have a go always a good time to learn. At the heart of the code, is the change object property. (vl-catch-all-apply 'vla-put-ExtensionLineColor (list Obj Color)) (vl-catch-all-apply 'vla-put-TextColor (list Obj Color)) (vl-catch-all-apply 'vla-put-DimensionLineColor (list Obj Color)) So if you look at the properties of an object using DUMPIT.lsp you should be able to work out correct Vla-put-property. DumpIt.LSP 1 Quote Link to comment Share on other sites More sharing options...
Saxlle Posted September 12 Share Posted September 12 (edited) Just for the fun, i made a lisp wich change a linetype for all blocks. (prompt (strcat "\nCopy and paste in command line: (command \"-LINETYPE\" \"?\" \"acadiso.lin\" \"\") to see all linetypes from \"acadiso.lin\" file. Then from the column \"Name\" copy desire name of linetype and paste it in after execute \"CLTP\" command! \nTo run a LISP type: CLTP")) (princ) (defun c:CLTP (/ ltype ename blk_name ss len i blk ent rtn etype obj) (setq ltype (getstring "\nEnter the linetype name:")) (princ) (if (not (tblsearch "LTYPE" ltype)) ;; if linetype doesn't exist, it will be loaded (progn (command "-LINETYPE" "L" ltype "acadiso.lin" "") (princ) ) ) (setq ename (car (entsel "\nSelect the desired block to change a linetype:"))) (princ) (while (/= "INSERT" (cdr (assoc 0 (entget ename)))) (prompt "\nSelected entitie is not a BLOCK! Try again...") (setq ename (car (entsel "\nSelect the desired block to change a linetype:"))) (princ) ) (setq blk_name (cdr (assoc 2 (entget ename)))) (setq ss (ssget "X" (list (cons 0 "INSERT") (cons 2 blk_name)))) (setq len (sslength ss)) (setq i 0) (while (< i len) (setq blk (cdr (assoc 2 (entget (ssname ss i))))) (if (setq ent (tblobjname "BLOCK" blk)) (while (/= ent nil) (setq ent (entnext ent)) (if (/= ent nil) (setq rtn (cons ent rtn)) ) ) ) (setq i (1+ i)) ) (setq i 0) (setq len (length rtn)) (while (< i len) (setq etype (cdr (assoc 0 (entget (nth i rtn))))) (if (or (= etype "LINE") (= etype "CIRCLE") (= etype "ARC") (= etype "LWPOLYLINE")) (progn (setq obj (vlax-ename->vla-object (nth i rtn))) (vlax-put-property obj 'Linetype ltype) (entupd (nth i rtn)) ) ) (setq i (1+ i)) ) (command "._regen") (princ) ) Best regards. Edited September 12 by Saxlle Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.