command with lisp load in conditional -bedit

command with lisp load in conditional -bedit

robert06
Collaborator Collaborator
1,109 Views
3 Replies
Message 1 of 4

command with lisp load in conditional -bedit

robert06
Collaborator
Collaborator

Hi,

 

I can't figure this out, after adding condition to check if the block exists in drawing, the 'csdf' command from "Convert_SaveDate_Fields_CSDF.lsp" won't execute as expected in the lisp:

 

Command: -bedit
Enter block name or [?]: blockname Regenerating model.
Regenerating model.

Command: Regenerating model.

Command: bsave
Command: bclose Regenerating model.

Command: ; error: bad function: C:CSDF

 

....

(if (tblsearch "block" "blockname")
(progn ((command "-bedit" "blockname")
(load "Convert_SaveDate_Fields_CSDF")
(c:csdf)
(command "bsave")
(command "bclose")
))
)

...

 

berfore:

...
(command "-bedit" "blockname")

(load "Convert_SaveDate_Fields_CSDF")
(c:csdf)
(command "bsave")
(command "bclose")

...

0 Likes
Accepted solutions (1)
1,110 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor
Accepted solution

Hi Robert,

you have an extra pair of () brackets inside progn function, try

 

(if (tblsearch "block" "blockname")
   (progn (command "-bedit" "blockname")
          (load "Convert_SaveDate_Fields_CSDF")
          (c:csdf)
          (command "bsave")
          (command "bclose")
   )
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 4

robert06
Collaborator
Collaborator

Thank you!

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

You're welcome, robert06
Glad I could help

Henrique

EESignature

0 Likes