Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strange error message in LISP

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
The_Caddie
568 Views, 6 Replies

Strange error message in LISP

I am trying to create a line between two defined points but get the following error

 

; error: An error has occurred inside the *error* function AutoCAD variable  setting rejected: "DYNMODE" nil

 

I have googeld it but can’t find anything on it. Just as some background information I didn’t use DYNAMODE or any error function, which has me a bit baffled then

 

Anyways here's the troubled code snippet.

 

 

(command "line" MYPOINT (strcat MYDIST ,0 ,0))

 

Also tried

 

(command "line" MYPOINT MYPOINT2)

 

Doesn’t do anything either…

6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: The_Caddie


@The_Caddie wrote:

I am trying to create a line between two defined points but get the following error

 

; error: An error has occurred inside the *error* function AutoCAD variable  setting rejected: "DYNMODE" nil

 

... here's the troubled code snippet.

 

(command "line" MYPOINT (strcat MYDIST ,0 ,0))

Also tried

(command "line" MYPOINT MYPOINT2)

.…


I couldn't say about DYNMODE without seeing the whole routine, but as for the (command) functions:

 

The first one, assuming MYDIST is a distance [real number] in the X direction othat you want to go from MYPOINT, should be either

(command "line" MYPOINT (strcat "@" (rtos MYDIST) ",0,0") "")

or

(command "line" MYPOINT (polar MYPOINT 0 MYDIST) "")

or there are a few other ways it could be done.

 

The second one also needs a "" [Enter] at the end to complete the Line command.

Kent Cooper, AIA
Message 3 of 7
The_Caddie
in reply to: Kent1Cooper

The cursor places the line but keeps on holding on to its endpoint and wont place that. Though the error has now changed to ; error bad argument type: numberp: nil

 

EDIT:

 

a better way to tackle this is perhaps to show me how I can place a line using two variables set to coordinate values found in model space.

 

After all the problem is how do I use variables to place a line.

 

(sorry my fault, complicated explanations) 

Message 4 of 7
Kent1Cooper
in reply to: The_Caddie


@The_Caddie wrote:

The cursor places the line but keeps on holding on to its endpoint and wont place that. though the error has now changed to ; error bad argument type: numberp: nil


That means some AutoLISP function that is expecting a number is being given nil instead.  The most likely reason for that is that the MYDIST variable does not have a value set into it, which is causing trouble for (rtos) and (polar).

Kent Cooper, AIA
Message 5 of 7
The_Caddie
in reply to: Kent1Cooper

yeah oops mabey if i spelled the two instances of the MYDIST and MYDIST1 variables equally the problem would go away (red facedWoman Embarassed)

Message 6 of 7
Kent1Cooper
in reply to: The_Caddie


@The_Caddie wrote:

... how I can place a line using two variables set to coordinate values ....


It appears from further messages that you've got it working, but in answer to the above:  The last line of code in your original post, with "" [Enter] added at the end to complete the Line command, would be the usual way.

Kent Cooper, AIA
Message 7 of 7
The_Caddie
in reply to: Kent1Cooper

Yes that worked with the enter...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost