rgutierrez Posted August 6, 2014 Posted August 6, 2014 Hi Guys, I'm creating a layer setting pull down menu, in order to migrate my cad to revit I would like to define the linewight. So far I managed to create a command with a dashed line: (defun c:layA-SEC-LIH-005() (command "layer" "m" "A-SEC-LIH-005""C" "magenta" "" "l""DASHED2" "" "") and another one with the lineweight (defun c:layA-SEC-LIH-005() (command "layer" "m" "A-SEC-LIH-005""C" "magenta" "" "_LW" 0.10"" "") but I haven't been able to create one that combines the 2 of them.. any help? Cheers Roberto Quote
feargt Posted August 6, 2014 Posted August 6, 2014 not sure why u couldn't get it to work, but after entering the linetype, instead of exiting the command continue by giving the lineweight. (defun c:layA-SEC-LIH-005 () (command "_-layer" "_m" "A-SEC-LIH-005" "_C" "magenta" "" "_l" "DASHED2" "_LW" "0.10" "" "" "") ) Quote
rgutierrez Posted August 6, 2014 Author Posted August 6, 2014 Hi feargt, Still doesn't work, I get a prompt asking to "Enter and option" [? Make Set New Rename ON OFF Color LType LWeight Transparency MAterial Plot Freeze Thaw LOck Unlock state Description rEconcile]: Doesn't work for you if you use the pull down menu? Quote
feargt Posted August 6, 2014 Posted August 6, 2014 copy this direct on to the command line (command "_-layer" "_m" "A-SEC-LIH-005" "_C" "magenta" "" "_l" "DASHED2" "_LW" "0.10" "" "" "") and see does it work. it works for me. if it does not work, press f2 and copy the text out so I can see where it stops working for you Quote
rgutierrez Posted August 6, 2014 Author Posted August 6, 2014 as requested.. btw.. thanks for helping Command: (command "_-layer" "_m" "A-SEC-LIH-005" "_C" "magenta" "" "_l" "DASHED2" "_LW" "0.10" "" "" "") _-layer Current layer: "0" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _m Enter name for new layer (becomes the current layer) : A-SEC-LIH-005 Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _C New color [Truecolor/COlorbook] : magenta Enter name list of layer(s) for color 6 (magenta) : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _l Enter loaded linetype name or [?] : DASHED2 Enter name list of layer(s) for linetype "DASHED2" : _LW No matching layer names found. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: 0.10 Invalid option keyword. Quote
MSasu Posted August 6, 2014 Posted August 6, 2014 Please pay attention that you missed to indicate the layer that will set the linetype for: ..."_L" "DASHED2" [color=red]"[font=Verdana][size=2]A-SEC-LIH-005"[/size][/font][/color]... or ..."_L" "DASHED2" [color=red]"[font=Verdana][size=2]"[/size][/font][/color]... Quote
rgutierrez Posted August 6, 2014 Author Posted August 6, 2014 I will try tomorrow on another computer.. still doesn't work for me.. g nite Command: (command "_-layer" "_m" "A-SEC-HIDDEN" "_C" "magenta" "" "_LT" "DASHED2" "_LW" "0.10" "" "" "") _-layer Current layer: "0" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _m Enter name for new layer (becomes the current layer) : A-SEC-HIDDEN Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _C New color [Truecolor/COlorbook] : magenta Enter name list of layer(s) for color 6 (magenta) : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: _LT Enter loaded linetype name or [?] : DASHED2 Enter name list of layer(s) for linetype "DASHED2" : _LW No matching layer names found. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: 0.10 Invalid option keyword. ; error: Function cancelled Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: *Cancel* Quote
feargt Posted August 6, 2014 Posted August 6, 2014 Thanks MSasu for picking that up: (command "_-layer" "_m" "A-SEC-LIH-005" "_C" "magenta" "" "_l" "DASHED2" "" "_LW" "0.10" "" "" "") Quote
BIGAL Posted August 6, 2014 Posted August 6, 2014 You may want to create a global lisp defun that just passes the variables using either entmake, command or VL eg (newlay "A- SEC-LIH-005" 5 "dashed2" 0.1) then you can use in any lisp you make. (defun newlay (lay col lt thick / ) (command "_-layer" "_m" lay "_C" col "" "_l" lt "" "_LW" thick "" "" "") ) Quote
Snownut Posted August 6, 2014 Posted August 6, 2014 You may want to create a global lisp defun that just passes the variables using either entmake, command or VL eg (newlay "A- SEC-LIH-005" 5 "dashed2" 0.1) then you can use in any lisp you make. (defun newlay (lay col lt thick / ) (command "_-layer" "_m" lay "_C" col "" "_l" lt "" "_LW" thick "" "" "") ) BIGAL, there seems to be some issues showing up in ACAD 2015 in using the "command" function in LISP. It seems AutoCad is slowly moving away from allowing this. The better way is to use the "vl-cmdf" function, this will require the (vl-load-com) at the beginning of the LISP. Quote
rgutierrez Posted August 6, 2014 Author Posted August 6, 2014 Hi Guys, What a great help, I want to thanks you all of you. Cheers feargr, MSasu, Bigal, Snownut!! cheers Quote
BIGAL Posted August 7, 2014 Posted August 7, 2014 Snownut following up I would probably use entmake or vl-addlayer now, did not want to confuse op, thats interesting perhaps create a new post 2015 & lisp ? Quote
rgutierrez Posted August 7, 2014 Author Posted August 7, 2014 Hi Guys, Again thanks for all your help.. I was having a chat with the IT guy and he introduced me to http://notepad-plus-plus.org/ great program to create the autoLISP Cheers Quote
SLW210 Posted August 7, 2014 Posted August 7, 2014 Please read the Code posting guidelines and edit your posts to include the code in code tags. Quote
rgutierrez Posted August 8, 2014 Author Posted August 8, 2014 Sorry.. next time for sure... thanks Quote
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.