Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Building a line and a circle

Anonymous
936 Views
4 Replies
Message 1 of 5

Building a line and a circle

Anonymous
Not applicable

What i am trying to do is to build a line and a circle in autocad using lisp.
The code:
( DEFUN C:myprog ()
( COMMAND "_erase" "_all" "" )
( COMMAND "_line" ( LIST 10 10 ) ( LIST 10 100 ) "" )
( COMMAND "_circle" "10.0,50.0" 30.0 "" )
)
As a result I get a correctly build line, but a wrong circle. The center of the circle is in the point (10,10) - the beginning of the line. But it's supposed to be in (10,50).
What am I doing wrong?

0 Likes
Accepted solutions (1)
937 Views
4 Replies
Replies (4)
Message 2 of 5

Ranjit_Singh2
Advisor
Advisor

I tested and it shows up correctly at 10,50 at my end.

Message 3 of 5

hmsilva
Mentor
Mentor
Accepted solution

@Anonymous wrote:

What i am trying to do is to build a line and a circle in autocad using lisp.
The code:
( DEFUN C:myprog ()
( COMMAND "_erase" "_all" "" )
( COMMAND "_line" ( LIST 10 10 ) ( LIST 10 100 ) "" )
( COMMAND "_circle" "10.0,50.0" 30.0 "" )
)
As a result I get a correctly build line, but a wrong circle. The center of the circle is in the point (10,10) - the beginning of the line. But it's supposed to be in (10,50).
What am I doing wrong?


Try

 

(DEFUN C:myprog ()
    (COMMAND "_erase" "_all" "")
    (COMMAND "_line" "_NON" (LIST 10 10) "_NON" (LIST 10 100) "")
    (COMMAND "_circle" "_NON" "10.0,50.0" 30.0 "")
)

 

Hope this helps,
Henrique

EESignature

Message 4 of 5

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...
( DEFUN C:myprog ()
( COMMAND "_erase" "_all" "" )
( COMMAND "_line" ( LIST 10 10 ) ( LIST 10 100 ) "" )
( COMMAND "_circle" "10.0,50.0" 30.0 "" )
)
....
What am I doing wrong?


To answer your question, you did not turn OSNAPS off. If they are still running, you can get unpredictible results. @hmsilva used the most simple way to do that.

Message 5 of 5

john.uhden
Mentor
Mentor
The difference, clearly to me anyway, is that the OP had a running object snap on, presumably to endpoint, so it picked up the endpoint of the line just created. That's why Henrique's use of "_None" temporarily turns off the snap so that the point supplied is taken literally.

John F. Uhden