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

Building a line and a circle

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
817 Views, 4 Replies

Building a line and a circle

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?

4 REPLIES 4
Message 2 of 5
Ranjit_Singh2
in reply to: Anonymous

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

Message 3 of 5
hmsilva
in reply to: Anonymous


@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
in reply to: Anonymous


@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
in reply to: Ranjit_Singh2

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

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

Post to forums  

Autodesk Customer Advisory Groups


Autodesk Design & Make Report