Would you like to react to this message? Create an account in a few clicks or log in to continue.

LISP for changing color of a line

+5
bimbim
aesonck
jean7
lord_clef
quicklearner
9 posters

Go down

LISP for changing color of a line Empty LISP for changing color of a line

Post by quicklearner Tue Oct 04, 2011 3:15 am

Mga Sir,
Baka may LISP kayo dyan na pedeng palitan ng color ang isang line. naencounter ko na to dati sa dati kong office sa pinas.
nagselect ako ng isang line tapos I pressed the key number " 1 " naging red yung line. tapos I pressed key number " 2 " naging yellow yung line. baka po pwede kong mahingi sa inyo ang LISP na to.

salamat po and God Bless CGPinoy...
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by lord_clef Tue Oct 04, 2011 3:58 am

may alam ako gumagawa nyan sir..magbabayad nga lng tyo
lord_clef
lord_clef
CGP Newbie
CGP Newbie

Number of posts : 192
Age : 40
Location : palo alto ca./makati city
Registration date : 16/08/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by quicklearner Tue Oct 04, 2011 4:04 am

ganun ba sir? mga magkano naman kaya sir.. just inform me sir..
pero kung may libre mas ok.. hehehe

salamat sir..
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by lord_clef Tue Oct 04, 2011 4:10 am

update kita sir nasa abroad na rin kc....master ng autolisp un .hehe
lord_clef
lord_clef
CGP Newbie
CGP Newbie

Number of posts : 192
Age : 40
Location : palo alto ca./makati city
Registration date : 16/08/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by quicklearner Tue Oct 04, 2011 4:12 am

ayos. salamat sir.. malaking tulong yan.

salamat ulit...
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by jean7 Tue Oct 04, 2011 7:53 am

;FREE lisp.... AutoCAD,ZWCAD,BricsCAD,ProgeCAD
;transparent command 'auto' does not function on some CAD systems
;i.e. BricsCAD 11
;most commands are keys on left of keyboard for easier input...
;just appload, modify/add as per your personal use ...(jean7-2011)

(DEFUN C:AD()
(PROMPT "<<< ADD LAYERS 1-7,TEXT >>> ")
(COMMAND "LAYER" "M" 1 "C" 1 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" 2 "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" 3 "C" 3 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" 4 "C" 4 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" 5 "C" 5 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" 6 "C" 6 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" 7 "C" 7 "" "LW" "0.30" "" "")
(COMMAND "LAYER" "M" 8 "C" 8 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "TEXT" "C" 3 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "DIMS" "C" 4 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" "OBJ" "C" 2 "" "LW" "0.25" "" "")
)


(DEFUN C:AD2()
(PROMPT "<<< ADD LAYERS Architectural >>> ")

(COMMAND "LAYER" "M" "WALL" "C" 4 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "COLUMN" "C" 7 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "DOOR" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "WINDOW" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "GRID" "C" 7 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" "MOULDING" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "DEFPOINTS" "C" 7 "" "LW" "0.10" "" "")
(COMMAND "LAYER" "M" "FURNITURE" "C" 8 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "FIXTURES" "C" 23 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "BORDER" "C" 6 "" "LW" "0.8" "" "")
(COMMAND "LAYER" "M" "JAMB" "C" 13 "" "LW" "0.25" "" "")

(COMMAND "LAYER" "M" "LABEL" "C" 3 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "ROOF" "C" 1 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "TILES" "C" 1 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "SLAB" "C" 7 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "HATCH" "C" 1 "" "LW" "0.15" "" "")
)

;Layer Manager

(DEFUN C:W1(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "1" "C" "1" ""))


(DEFUN C:W2(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "2" "C" "2" ""))


(DEFUN C:W3(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "3" "C" "3" ""))


(DEFUN C:W4(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "4" "C" "4" ""))


(DEFUN C:W5(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "5" "C" "5" ""))


(DEFUN C:W6(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "6" "C" "6" ""))


(DEFUN C:W7(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "7" "C" "7" ""))


(DEFUN C:W8(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "8" "C" "8" ""))

;set to current layer & color

(DEFUN C:Q1()
(COMMAND "layer" "s" "1" "c" "1" "" ""))

(DEFUN C:Q2()
(COMMAND "layer" "s" "2" "c" "2" "" ""))

(DEFUN C:Q3()
(COMMAND "layer" "s" "3" "c" "3" "" ""))

(DEFUN C:Q4()
(COMMAND "layer" "s" "4" "c" "4" "" ""))

(DEFUN C:Q5()
(COMMAND "layer" "s" "5" "c" "5" "" ""))

(DEFUN C:Q6()
(COMMAND "layer" "s" "6" "c" "6" "" ""))

(DEFUN C:Q7()
(COMMAND "layer" "s" "7" "c" "7" "" ""))

(DEFUN C:Q8()
(COMMAND "layer" "s" "8" "c" "8" "" ""))

(DEFUN C:11(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "1" "LT" "CONTINUOUS" ""))

(DEFUN C:22(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "2" "LT" "CONTINUOUS" ""))

(DEFUN C:33(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "3" "LT" "CONTINUOUS" ""))

(DEFUN C:44(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "4" "LT" "CONTINUOUS" ""))

(DEFUN C:55(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "5" "LT" "CONTINUOUS" ""))

(DEFUN C:66(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "6" "LT" "CONTINUOUS" ""))

(DEFUN C:77(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "7" "LT" "CONTINUOUS" ""))

(DEFUN C:88(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "8" "LT" "CONTINUOUS" ""))


(DEFUN C:111(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "1" "LT" "HIDDEN" ""))

(DEFUN C:222(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "2" "LT" "HIDDEN" ""))

(DEFUN C:333(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "3" "LT" "HIDDEN" ""))

(DEFUN C:444(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "4" "LT" "HIDDEN" ""))

(DEFUN C:555(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "5" "LT" "HIDDEN" ""))

(DEFUN C:6-(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "6" "LT" "HIDDEN" ""))

(DEFUN C:777(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "7" "LT" "HIDDEN" ""))

(DEFUN C:888(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "8" "LT" "HIDDEN" ""))

;Automatic functions
(DEFUN C:AE()
(PROMPT "AUTO-ERASE <> ")
(COMMAND "ERASE" "SINGLE" "AUTO"))

(DEFUN C:AEE(/ a)
(PROMPT "AUTO-ERASE <> ")
(setq a (ssget ""))
(COMMAND "ERASE" a ""))

(DEFUN C:AC()
(PROMPT "AUTO-COPY <> ")
(COMMAND "COPY" "SINGLE" "AUTO")
)

(DEFUN C:ACC(/ a)
(PROMPT "AUTO-COPY <> ")
(setq a (ssget))
(command "copy" a "")
)

(DEFUN C:AA1()
(PROMPT "AUTO-COPY <> ")
(COMMAND "COPY" "L" ""))

(DEFUN C:QE()
(PROMPT "AUTO-MOVE <> ")
(COMMAND "MOVE" "SINGLE" "AUTO"))

(DEFUN C:QE2()
(PROMPT "MOVE-LAST <> ")
(COMMAND "MOVE" "L" ""))

(DEFUN C:QE3()
(PROMPT "MOVE-PREVIOUS <> ")
(COMMAND "MOVE" "P" ""))

(DEFUN C:AS()
(PROMPT "ERASE LAST <> ")
(COMMAND "ERASE" "L" ""))

(DEFUN C:AS1()
(PROMPT "EXPLODE LAST <> ")
(COMMAND "EXPLODE" "L"))

(DEFUN C:ED()
(COMMAND "EDIT" ))

(DEFUN C:EF()
(PROMPT "EDIT-LAST <> ")
(COMMAND "DDEDIT" "L" ""))

(DEFUN C:EF1()
(PROMPT "EDIT-LAST <> ")
(COMMAND "DDEDIT" "L" ""))

(DEFUN C:SF(/ A)
(PROMPT " << MULTIPLE COPY >> ")
(SETQ A (SSGET))
(COMMAND "COPY" A "" "M"))

(DEFUN C:SF1(/ A)
(PROMPT " << MULTIPLE COPY-LAST >> ")
(COMMAND "COPY" "L" "" "M"))

(DEFUN C:XX()
(PROMPT "<< EXPLODE >> ")
(COMMAND "EXPLODE"))

(DEFUN C:SC()
(PROMPT "<< SCALE >> <> ")
(COMMAND "SCALE" ))

(DEFUN C:SC1()
(PROMPT "<< SCALE-LAST >> <> ")
(COMMAND "SCALE" "L" ""))




jean7
CGP Newbie
CGP Newbie

Number of posts : 91
Age : 47
Location : 'pinas
Registration date : 14/01/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by quicklearner Tue Oct 04, 2011 10:28 pm

salamat jean7. kaso pano ba gamitin to? open ako ng notepad tapos paste and save. tama ba?
salamat ulit..
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by aesonck Tue Oct 04, 2011 10:43 pm

1.Open Notepad
2.Copy then paste
3.(SAVING) Put filename and add dot lsp or (.lsp)
4.Type Ap then load
5.And also add it in contents
6.Tick again load
7.That's it! Smile
aesonck
aesonck
CGP Expert
CGP Expert

Number of posts : 2448
Age : 44
Location : Philippines. La Trinidad-Visayas
Registration date : 13/07/2010

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by quicklearner Tue Oct 04, 2011 10:55 pm

salamat sir aesonck.. more power..
salamat ulit jean7.. God BLess..
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty request nyo sir...

Post by bimbim Wed Oct 05, 2011 12:01 am

(defun c:1 () (command "select" pause)
(command "chprop" "p" "" "c" "1" "") )

(defun c:2 () (command "select" pause)
(command "chprop" "p" "" "c" "2" "") )

(defun c:3 () (command "select" pause)
(command "chprop" "p" "" "c" "3" "") )

(defun c:4 () (command "select" pause)
(command "chprop" "p" "" "c" "4" "") )

(defun c:5 () (command "select" pause)
(command "chprop" "p" "" "c" "5" "") )

(defun c:6 () (command "select" pause)
(command "chprop" "p" "" "c" "6" "") )

(defun c:7 () (command "select" pause)
(command "chprop" "p" "" "c" "7" "") )

(defun c:8 () (command "select" pause)
(command "chprop" "p" "" "c" "8" "") )


copy and paste nyo sir un script sa notepad then save-as nyo sa prefered file name (e.g. color.lsp)

type APPLOAD sa commandline, magopen ung LOAD APPLICATIONS window

just browse, click the file then click LOAD

or kung gusto mo sir automatic na cia ma-load everytime i-open mo un ACAD, click mo CONTENTS sa lower right part ADD mo sa list un LSP. REMOVE mo na lang in case malipat ka ng workstation.


in case meron ka gusto kulay na idagdag, just copy the script line below:

(defun c:* () (command "select" pause)
(command "chprop" "p" "" "c" "*" "") )

edit mo lang un asterisks (*) to the number of color you want to add

COMMAND PROCESS:

type the number, spacebar, select the object/s, spacebar

hope this helps. good day!
bimbim
bimbim
CGP Newbie
CGP Newbie

Number of posts : 21
Age : 44
Location : Mandaluyong
Registration date : 01/04/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by quicklearner Wed Oct 05, 2011 12:35 am

sir bimbim, ito na yun.. salamat nang maraming marami..
God Bless... 2thumbsup
quicklearner
quicklearner
CGP Newbie
CGP Newbie

Number of posts : 74
Age : 40
Location : dubai, uae
Registration date : 07/02/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by bimbim Wed Oct 05, 2011 1:13 am

anytime sir.buti nakutong LISP for changing color of a line 290602
bimbim
bimbim
CGP Newbie
CGP Newbie

Number of posts : 21
Age : 44
Location : Mandaluyong
Registration date : 01/04/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by wizman Fri Dec 02, 2011 2:23 pm

add ko lang po:

(defun chco (color / ss1)
(setq ss1 (ssget))
(command "._change" ss1 "" "p" "c" color "" )
)
(setq i 1)
(while (<= i 254)
(eval (read (strcat "(defun c:" (itoa i) (chr 40)(chr 41) "(chco " (itoa i) "))")))
(setq i (1+ i))
)


regards,

wiz

wizman

Number of posts : 2
Age : 43
Location : abu dhabi
Registration date : 02/12/2011

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by totzkimol Thu Mar 29, 2012 9:29 pm

share ko lang din yung LISP ko baka makatulong din...sana may magshare din ng mga lisp nila...thank you

text transfer
============================================
(defun C:TT ( / A B)
(setq A (cdr (assoc 1 (entget (car (entsel "Select TEXT to transfer: "))))))
(while (setq B (car (entsel "Select TEXT item to replace: ")))
(setq C (entget B))
(entmod (subst (cons 1 A)(assoc 1 C)C))
(if (or (= (cdr (assoc 0 C)) "POLYLINE")(= (cdr (assoc 0 C)) "INSERT"))
(entupd B)))

(princ)
)

(c:tt)
totzkimol
totzkimol
CGP Newbie
CGP Newbie

Number of posts : 7
Age : 41
Location : Manila, Philippines
Registration date : 25/02/2012

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by ciaoriki Mon Apr 16, 2012 12:22 am

jean7 wrote:;FREE lisp.... AutoCAD,ZWCAD,BricsCAD,ProgeCAD
;transparent command 'auto' does not function on some CAD systems
;i.e. BricsCAD 11
;most commands are keys on left of keyboard for easier input...
;just appload, modify/add as per your personal use ...(jean7-2011)

(DEFUN C:AD()
(PROMPT "<<< ADD LAYERS 1-7,TEXT >>> ")
(COMMAND "LAYER" "M" 1 "C" 1 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" 2 "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" 3 "C" 3 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" 4 "C" 4 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" 5 "C" 5 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" 6 "C" 6 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" 7 "C" 7 "" "LW" "0.30" "" "")
(COMMAND "LAYER" "M" 8 "C" 8 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "TEXT" "C" 3 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "DIMS" "C" 4 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" "OBJ" "C" 2 "" "LW" "0.25" "" "")
)


(DEFUN C:AD2()
(PROMPT "<<< ADD LAYERS Architectural >>> ")

(COMMAND "LAYER" "M" "WALL" "C" 4 "" "LW" "0.25" "" "")
(COMMAND "LAYER" "M" "COLUMN" "C" 7 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "DOOR" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "WINDOW" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "GRID" "C" 7 "" "LW" "0.15" "" "")
(COMMAND "LAYER" "M" "MOULDING" "C" 2 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "DEFPOINTS" "C" 7 "" "LW" "0.10" "" "")
(COMMAND "LAYER" "M" "FURNITURE" "C" 8 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "FIXTURES" "C" 23 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "BORDER" "C" 6 "" "LW" "0.8" "" "")
(COMMAND "LAYER" "M" "JAMB" "C" 13 "" "LW" "0.25" "" "")

(COMMAND "LAYER" "M" "LABEL" "C" 3 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "ROOF" "C" 1 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "TILES" "C" 1 "" "LW" "0.2" "" "")
(COMMAND "LAYER" "M" "SLAB" "C" 7 "" "LW" "0.3" "" "")
(COMMAND "LAYER" "M" "HATCH" "C" 1 "" "LW" "0.15" "" "")
)

;Layer Manager

(DEFUN C:W1(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "1" "C" "1" ""))


(DEFUN C:W2(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "2" "C" "2" ""))


(DEFUN C:W3(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "3" "C" "3" ""))


(DEFUN C:W4(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "4" "C" "4" ""))


(DEFUN C:W5(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "5" "C" "5" ""))


(DEFUN C:W6(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "6" "C" "6" ""))


(DEFUN C:W7(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "7" "C" "7" ""))


(DEFUN C:W8(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "p" "LA" "8" "C" "8" ""))

;set to current layer & color

(DEFUN C:Q1()
(COMMAND "layer" "s" "1" "c" "1" "" ""))

(DEFUN C:Q2()
(COMMAND "layer" "s" "2" "c" "2" "" ""))

(DEFUN C:Q3()
(COMMAND "layer" "s" "3" "c" "3" "" ""))

(DEFUN C:Q4()
(COMMAND "layer" "s" "4" "c" "4" "" ""))

(DEFUN C:Q5()
(COMMAND "layer" "s" "5" "c" "5" "" ""))

(DEFUN C:Q6()
(COMMAND "layer" "s" "6" "c" "6" "" ""))

(DEFUN C:Q7()
(COMMAND "layer" "s" "7" "c" "7" "" ""))

(DEFUN C:Q8()
(COMMAND "layer" "s" "8" "c" "8" "" ""))

(DEFUN C:11(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "1" "LT" "CONTINUOUS" ""))

(DEFUN C:22(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "2" "LT" "CONTINUOUS" ""))

(DEFUN C:33(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "3" "LT" "CONTINUOUS" ""))

(DEFUN C:44(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "4" "LT" "CONTINUOUS" ""))

(DEFUN C:55(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "5" "LT" "CONTINUOUS" ""))

(DEFUN C:66(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "6" "LT" "CONTINUOUS" ""))

(DEFUN C:77(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "7" "LT" "CONTINUOUS" ""))

(DEFUN C:88(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "8" "LT" "CONTINUOUS" ""))


(DEFUN C:111(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "1" "LT" "HIDDEN" ""))

(DEFUN C:222(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "2" "LT" "HIDDEN" ""))

(DEFUN C:333(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "3" "LT" "HIDDEN" ""))

(DEFUN C:444(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "4" "LT" "HIDDEN" ""))

(DEFUN C:555(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "5" "LT" "HIDDEN" ""))

(DEFUN C:6-(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "6" "LT" "HIDDEN" ""))

(DEFUN C:777(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "7" "LT" "HIDDEN" ""))

(DEFUN C:888(/ A)
(SETQ A (SSGET))
(COMMAND "CHANGE" A "" "P" "C" "8" "LT" "HIDDEN" ""))

;Automatic functions
(DEFUN C:AE()
(PROMPT "AUTO-ERASE <> ")
(COMMAND "ERASE" "SINGLE" "AUTO"))

(DEFUN C:AEE(/ a)
(PROMPT "AUTO-ERASE <> ")
(setq a (ssget ""))
(COMMAND "ERASE" a ""))

(DEFUN C:AC()
(PROMPT "AUTO-COPY <> ")
(COMMAND "COPY" "SINGLE" "AUTO")
)

(DEFUN C:ACC(/ a)
(PROMPT "AUTO-COPY <> ")
(setq a (ssget))
(command "copy" a "")
)

(DEFUN C:AA1()
(PROMPT "AUTO-COPY <> ")
(COMMAND "COPY" "L" ""))

(DEFUN C:QE()
(PROMPT "AUTO-MOVE <> ")
(COMMAND "MOVE" "SINGLE" "AUTO"))

(DEFUN C:QE2()
(PROMPT "MOVE-LAST <> ")
(COMMAND "MOVE" "L" ""))

(DEFUN C:QE3()
(PROMPT "MOVE-PREVIOUS <> ")
(COMMAND "MOVE" "P" ""))

(DEFUN C:AS()
(PROMPT "ERASE LAST <> ")
(COMMAND "ERASE" "L" ""))

(DEFUN C:AS1()
(PROMPT "EXPLODE LAST <> ")
(COMMAND "EXPLODE" "L"))

(DEFUN C:ED()
(COMMAND "EDIT" ))

(DEFUN C:EF()
(PROMPT "EDIT-LAST <> ")
(COMMAND "DDEDIT" "L" ""))

(DEFUN C:EF1()
(PROMPT "EDIT-LAST <> ")
(COMMAND "DDEDIT" "L" ""))

(DEFUN C:SF(/ A)
(PROMPT " << MULTIPLE COPY >> ")
(SETQ A (SSGET))
(COMMAND "COPY" A "" "M"))

(DEFUN C:SF1(/ A)
(PROMPT " << MULTIPLE COPY-LAST >> ")
(COMMAND "COPY" "L" "" "M"))

(DEFUN C:XX()
(PROMPT "<< EXPLODE >> ")
(COMMAND "EXPLODE"))

(DEFUN C:SC()
(PROMPT "<< SCALE >> <> ")
(COMMAND "SCALE" ))

(DEFUN C:SC1()
(PROMPT "<< SCALE-LAST >> <> ")
(COMMAND "SCALE" "L" ""))






_____________________________________

ang haba naman ng code na ito just to change the color of a line, sa vb, 10 lines lang ito. ito ang ayaw ko sa lisp, mas marami pa ang parenthesis kaysa sa code

ciaoriki
CGP Newbie
CGP Newbie

Number of posts : 76
Age : 64
Location : united states
Registration date : 15/08/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by cadmagic Thu Jul 12, 2012 2:45 am

HERE'S ANOTHER AUTOLISP I DID WHEN I WAS SO ADDICTED TO LISP MAKING WAY BACK 8 YEARS AGO.

JUST COPY THE CODE AND PASTE IN NOTEPAD AND SAVE IT AS ANY NAME YOU WANT BUT I CALL THIS INVISIBLE AND VISIBLE AND JUST MAKE SURE TO PUT A .LSP EXTENSION TO IT.


(defun C:00 (/ ent) ; mawagtang ka hahahhaha
(setq ent (entget (car (entsel))))
(if (assoc 60 ent)
(setq ent (subst '(60 . 1) (assoc 60 ent) ent))
(setq ent (append ent '((60 . 1)))))
(entmod ent)
(princ)
(ALERT "\n WAGTANG MAN UG KALIT HAHAHHAHA")
)

(defun C:11 (/ ss n ent) ; mobalik ka hahahhahaha
(setq ss (ssget "x" '((60 . 1)))
n (1- (sslength ss)))
(while (>= n 0)
(setq ent (entget (ssname ss n))
ent (subst '(60 . 0) (assoc 60 ent) ent)
n (1- n))
(entmod ent))
(princ)
(ALERT "\n NIBALIK NA HAHAHAHHA")
)



cadmagic
CGP Newbie
CGP Newbie

Number of posts : 55
Age : 47
Location : Cebu City/ Jeddah, Saudi Arabia
Registration date : 19/12/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by cadmagic Thu Jul 12, 2012 2:47 am

and one more thing i still need to fix it though its functional ang problema lang dapat mauna ang command na 00 kay sa 11. For now wala pa ako time to analyze the bug.

cadmagic
CGP Newbie
CGP Newbie

Number of posts : 55
Age : 47
Location : Cebu City/ Jeddah, Saudi Arabia
Registration date : 19/12/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by jean7 Tue Sep 04, 2012 7:38 pm

ok... ito ay general function for changing color sa lisp

Code:
(defun c:col(/ s n)(initget (+ 1 2 4))
(setq n(getint "\nColor # (1-255): ") s(ssget ":s")) 
(command "change" s "" "p" "c" n ""))

sa AutoCAD 1-255 ang range

sa BricsCAD 0-256 ang range at ang initget ay (+ 1 4) lang...

jean7
CGP Newbie
CGP Newbie

Number of posts : 91
Age : 47
Location : 'pinas
Registration date : 14/01/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by cadmagic Wed Sep 05, 2012 12:04 am

(defun c:1 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "1" "" "")
)
(defun c:2 (/ f)
(setq f (ssget))




(command
"change" f "" "p" "c" "2" "" "")
)
(defun c:3 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "3" "" "")
)
(defun c:4 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "4" "" "")
)
(defun c:5 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "5" "" "")
(princ)
)
(defun c:6 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "6" "" "")
)
(defun c:7 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "7" "" "")
)
(defun c:8 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "8" "" "")
)
(defun c:9 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "9" "" "")
)
(defun c:31 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "31" "" "")
)
(defun c:65 (/ f)
(setq f (ssget))
(command
"change" f "" "p" "c" "65" "" "")


)

(defun c:100 (/ f)
(setq f (ssget))

(command "change" f "" "p" "c" "100" "" "")
)
(defun c:92 (/ f)
(setq f (ssget))

(command "change" f "" "p" "c" "100" "" "")
)
(defun c:41 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "41" "" "")
)
(defun c:48 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "55" "" "")
)
(defun c:253 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "253" "" "")
)
(defun c:63 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "63" "" "")
)
(defun c:135 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "135" "" "")
)
(defun c:97 (/ f)
(setq f (ssget))
;;MALI - COMMENT: The CHANGE command has new options.
(command "change" f "" "p" "c" "97" "" "")
)
(defun c:20 (/ f)
(setq f (ssget))

(command "change" f "" "p" "c" "20" "" "")
)

cadmagic
CGP Newbie
CGP Newbie

Number of posts : 55
Age : 47
Location : Cebu City/ Jeddah, Saudi Arabia
Registration date : 19/12/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by jean7 Wed Sep 05, 2012 12:47 am

kung may mali yung function sa kin pakibago na lang sa format na bigay ni 'cadmagic', try ko sa CAD 2007 at BricsCAD 2012 ito at hindi sa newer version ng AutoCAD....LISP for changing color of a line 290602

jean7
CGP Newbie
CGP Newbie

Number of posts : 91
Age : 47
Location : 'pinas
Registration date : 14/01/2009

Back to top Go down

LISP for changing color of a line Empty Re: LISP for changing color of a line

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum