tzframpton Posted September 8, 2008 Posted September 8, 2008 I'm writing a custom LISP to grab all entities with a custom LINETYPE and change it to a normal AutoCAD related Linetype. I don't need to use the ENTSEL with a DXF Group Code function because I already know the Linetype name. I think I can just simply use the CHPROP method but it's asking to Select Objects when I use it. I'm just wondering what is the best way for me to use the SETQ function for the Linetype. Hope this makes sense. Thanks in advance for the help. Quote
ASMI Posted September 8, 2008 Posted September 8, 2008 Hi. Change "DASHED" into custom linetype. (defun c:cln(/ lSet) (if(setq lSet(ssget "_X" '((6 . [color="Blue"]"DASHED"[/color])))) (progn (princ(strcat "\n" (itoa(sslength lSet)) " objects found.")) (sssetfirst nil lSet) (initget "Yes No") (if(= "Yes"(getkword "\nChange linetype? [Yes/No]: ")) (command "_.chprop" lSet "" "_lt" "Continuous" "") (sssetfirst nil nil) ); end if ); end progn ); end if (princ) ); end of c:cln Quote
tzframpton Posted September 8, 2008 Author Posted September 8, 2008 Oh okay, SSGET is what I'm after. I will try it now... ASMI thanks for the code but I was wanting to learn myself... lol. You spoil me, you know this right? Quote
ASMI Posted September 8, 2008 Posted September 8, 2008 ASMI thanks for the code but I was wanting to learn myself... lol. You spoil me, you know this right? Probably, excuse if it so. But you have many possibilities to write a code by another. Absolutely on another... Quote
David Bethel Posted September 9, 2008 Posted September 9, 2008 Maybe to change from HIDDEN to BYLAYER: (defun c:rlt (/ ss) (and (setq ss (ssget "X" (list (cons 6 "HIDDEN")))) (command "_.CHANGE" ss "" "_P" "_LT" "BYLAYER" "")) (prin1)) -David Quote
tzframpton Posted September 9, 2008 Author Posted September 9, 2008 ASMI, David, worked perfectly. Thanks again guys!! ASMI next time teach me instead of writing a code for me, haha.... :wink: I was on the right track, I just forgot about using the SSGET function. I know in the DXF Group Codes that 6 is referred to Linetypes. Quick question David, the code in (cons 6 "HIDDEN") is this '6' still associated with Linetypes such as in the DXF Group Codes? Just wondering is all. Thanks again everyone. Quote
David Bethel Posted September 10, 2008 Posted September 10, 2008 StykFacE, Yes, 6 is linetypes. The VLisp help is actually a pretty good reference. For a list of all of the numerical codes: DXF Reference Table Of Contents -> DXF Format -> Group Codes In Numerical Order -David 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.