Create Layer with lisp

Anonymous

Create Layer with lisp

Anonymous
Not applicable

i just writing the code its have some error kindly let me what is issue here 

 

 

(defun c:AC-Lay ()
(setvar "cmdecho" 0)
(prompt "\n !! Ac Standard Layer Setting !!")(command "layer"
"n" "PC-H-COND-A" "c" "7" "PC-H-COND-A"
"n" "PC-H-COND-B" "c" "7" "PC-H-COND-B"
"n" "PC-H-LIGHT" "c" "3" "PC-H-LIGHT"
"n" "PC-H-EM-LIGHT" "c" "3" "PC-H-EM-LIGHT"
"n" "PC-H-WIRE" "c" "1" "PC-H-WIRE"
"n" "PC-H-DIM" "c" "1" "PC-H-DIM"
"n" "PC-H-EM-TEXT" "c" "3" "PC-H-EM-TEXT"
"n" "PC-H-TEXT" "c" "2" "PC-H-TEXT"

(prompt "\n !!! AC Standard Layer Setting Done !!!")
(prompt "\n !!! Created by Engineering Service !!!")
)

\nHvac Layer setting, Start command with `AC-Lay' !!!

@Anonymous 

0 Likes
Reply
768 Views
2 Replies
Replies (2)

cadffm
Consultant
Consultant

@Anonymous  schrieb:

i just writing the code its have some error kindly let me what is issue here 


That is not what i name "writing the code"

It's "written something and hoping it works"

What i want to say: Write your code step by step (and test the code between the steps),

this way you never combine a fail with a fail with a fail, what makes it much difficult to find the problem by yourself.

 

 

(defun c:AC-Lay ()
(setvar "cmdecho" 0)
(prompt "\n !! Ac Standard Layer Setting !!")
(command "_.-layer"
"_n" "PC-H-COND-A" "_c" "7" "PC-H-COND-A"
"_n" "PC-H-COND-B" "_c" "7" "PC-H-COND-B"
"_n" "PC-H-LIGHT" "_c" "3" "PC-H-LIGHT"
"_n" "PC-H-EM-LIGHT" "_c" "3" "PC-H-EM-LIGHT"
"_n" "PC-H-WIRE" "_c" "1" "PC-H-WIRE"
"_n" "PC-H-DIM" "_c" "1" "PC-H-DIM"
"_n" "PC-H-EM-TEXT" "_c" "3" "PC-H-EM-TEXT"
"_n" "PC-H-TEXT" "_c" "2" "PC-H-TEXT"
""
)
(prompt "\n !!! AC Standard Layer Setting Done !!!")
(prompt "\n !!! Created by Engineering Service !!!")
)

For example the LAYER command is not completed.

Try it yourself, start -LAYER command (this command starts with your code, also if you wrote "LAYER", ACAD starts the "-LAYER" command.

 

Command: -LAYER<enter>

n<enter>123<enter>c<enter>6<enter>123<enter>

<NOW look into your commandline or Textscreen[F2]>

The -LAYER command is still running! You have to send an ENTER to leave the command,

in you (command statement is 'just an Enter' = "")

(command "_.-LAYER" "_new" "123" "_co" "6" "123" "")

 

Another thing was a missing bracket to close your (command "Layer" ...) statement

Sebastian

0 Likes

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

i just writing the code its have some error kindly let me what is issue here 

 

 

(defun c:AC-Lay ()
(setvar "cmdecho" 0)
(prompt "\n !! Ac Standard Layer Setting !!")(command "layer"
"n" "PC-H-COND-A" "c" "7" "PC-H-COND-A"
"n" "PC-H-COND-B" "c" "7" "PC-H-COND-B"
... (prompt "\n !!! Created by Engineering Service !!!") )


 

I don't think the code is complete.

Just after (setvar "cmdecho") should follow (setvar "nomutt" 1).

That way I'll enjoy your services.