Jump to content

run lisp routine error unknown command


dax

Recommended Posts

more than likey that the directory does not exist VLIDE gave up here

 

(setq file (open "C:\\aut13\\extractedpsvdata.csv" "a"))
   (write-line (strcat filename "," tagNo "," press "," size) file)
         [color=red](close file)[/color]
[color=red]

[/color]

Link to comment
Share on other sites

more than likey that the directory does not exist VLIDE gave up here

 

(setq file (open "C:\\aut13\\extractedpsvdata.csv" "a"))
   (write-line (strcat filename "," tagNo "," press "," size) file)
         [color=red](close file)[/color]
[color=red]

[/color]

 

Hi BIGAL,

 

Thank you for your response. The directory exist, thought my lisp routine was working, but when I executed this to multiple drawings (using script file), it does not moved to the another drawings. I've also notice the "unknown command extractentity (which is in my program), but when I added (command "") or just pressing "enter command" on my program it just executed. I think this error causing the problem that why it did not moved to the another drawings.

Link to comment
Share on other sites

Maybe you will get more answers if you post a test drawing.

Exactly explaining what the program should do may also help (why the temporary circle?).

Link to comment
Share on other sites

Maybe you will get more answers if you post a test drawing.

Exactly explaining what the program should do may also help (why the temporary circle?).

 

Hi Roy,

 

Thanks for your response, there something wrong with my code when executing the lisp program thru .scr file, it gives me a unknown command "wp" which is reside on my lisp. But when this executed manually it just executed cleanly.

 

(inside .scr file)

 

.OPEN

"drawing name"

ZOOM

A

(C:EXTRACTPSVDATA)

 

this working perfectly when entering manually..

 

Regards,

 

Dax

Link to comment
Share on other sites

OK that is very useful information.

 

The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation).

 

Instead of:

(if (zerop (getvar 'cmdactive))
 ...
)

Use:

(if (zerop (logand (getvar 'cmdactive) 3))
 ...
)

Link to comment
Share on other sites

OK that is very useful information.

 

The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation).

 

Instead of:

(if (zerop (getvar 'cmdactive))
 ...
)

Use:

(if (zerop (logand (getvar 'cmdactive) 3))
 ...
)

 

Hi Roy,

 

After changing the code, its works perfectly..:D. Thanks much!! have your tried to load this kind of lisp to multiple drawings without using third party tools like script pro.. etc.

Just wondering this is possible :

 

- run batch program (open autocad and run .scr file)

- .scr file will execute .lsp file to create another .scr file that contain list of drawings.

Sample.

.OPEN

"drawing name1"

(load "lisp program")

lisp program

.CLOSE

Y

.OPEN

"drawing name2"

(load "lisp program")

lisp program

.CLOSE

Y

 

 

Regards,

 

Dax

Link to comment
Share on other sites

Just wondering this is possible :

 

- run batch program (open autocad and run .scr file)

- .scr file will execute .lsp file to create another .scr file that contain list of

Probably. But I must say I do not understand the logic behind this approach.
Link to comment
Share on other sites

Probably. But I must say I do not understand the logic behind this approach.

 

This is a automation to extract data/attribute from a specific entity, initially I do this with batch program, but prob with this approach is that it open and close autocad instance per drawing, thats why I change it to iterate thru a .scr file. Im planning to have a UI on this on Excel format and the output will be also on Excel. The user for this been able to input text value and directory of the drawings.

 

Regards,

 

Dax

Link to comment
Share on other sites

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...