Jump to content

Recommended Posts

Posted (edited)

I have had this scrip for years. I am running Autocad 2022 right now. I have been a mbemer on here for over 15 years I can not get in my old account Efeezy. Can someone fix this. I use it for my backgrounds. It cleanes everything up really fast. I run a script before this to change all the colors to red or what ever so evething I don't need stands out.   I am glad this site is still here.

 

ERROR WTF MAYBE MAKE NEW SCRIPT
-----------------------------------------------
LAYCOL 

(defun c:98 ( / col lay lst )
    (setq lst
       '(
            ("*MATC*"          . 001)
            ("*SYMB*"          . 001)
            ("*existing*wall*" . 009)
            ("*wall*"          . 009)
            ("*-wall*"         . 009)
            ("*COLS*"          . 009)
            ("*BEAM*"          . 009)
            ("*door*"          . 009)
            ("*stairs*"        . 009)
            ("*stair*"         . 009)
            ("*strs*"          . 009)
            ("*grid*"          . 113)      
            ("*area-iden*"     . 113)
            ("*ANNO-TEXT*"     . 142)
	    ("*Sanr-fixt*"     . 160)
            ("*glaz*"          . 141)
            ("*window*"        . 141)
            ("*glazing*"       . 141)
            ("*SPCQ*"          . 141)
            ("*CASE*"          . 043)
            ("*furniture*"     . 043)
            ("*A-FLOR-FURN*"   . 043)     
            ("*ROOF*"          . 151)
            ("*HVAC*"          . 031)
            ("*LITE*"          . 103)
            ("*CLNG*"          . 181)
            ("*fixture*"       . 160)
            ("*P-FIXT*"        . 160)
	    ("*EN-LITE-CIRC    . 160)
        )
    )
    (vlax-for obj (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
        (if (setq lay (strcase (vla-get-name obj))
                  col (vl-some '(lambda ( x ) (if (wcmatch lay (strcase (car x))) (cdr x))) lst)
            )
            (vla-put-color obj col)
        )
    )
    (princ)
)
(vl-load-com) (princ)

 

Edited by Efeezy2
Posted
13 hours ago, Efeezy said:

I have been a mbemer on here for over 15 years I can not get in my old account Efeezy. Can someone fix this.

 

Done. Please see your email for new login details.

Posted

It may be as simple as delete these lines at start. I did not look any further. Add (c:98) as last line then it will run when you load it.

 

ERROR WTF MAYBE MAKE NEW SCRIPT
-----------------------------------------------
LAYCOL 

 

Posted

the lines seperate the lips in my list. I am not sure why this code no longer works.  Ioaded it in Autocad 2022 

Posted (edited)

change this : 

("*EN-LITE-CIRC   . 160)

to this 

("*EN-LITE-CIRC"  . 160)

 

and if you want to keep this line 

ERROR WTF MAYBE MAKE NEW SCRIPT

-----------------------------------------------

LAYCOL

 

add a ;; before the line as bigal pointed out

;;ERROR WTF MAYBE MAKE NEW SCRIPT

;;-----------------------------------------------

;;LAYCOL

 

Edited by nod684
  • Like 2
Posted

To add to this, if you had pasted the code into the VLIDE, the color coding is an easy indicator of the missing " since all the code at the end is color coded as a string.

 

image.thumb.png.ceb88ee944b0a4c1fca26415a3e7f255.png

  • Like 1
Posted

Thank youronjonp & nod684, I will update my script right now. one little "..... I didn't even notice. 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...