Jump to content
neko_designer

beginner - code help

Recommended Posts

neko_designer

hi, I just started reading about lisp and made my first "script", but it is giving me an error after drawing the first rectangle, and wont draw the next. can anyone tell me what am I doing wrong? thanks in advance

 

(defun c:pl()

(command "_thickness" 1 "")
(command "_circle" '(0 0 0) 1 "")
(command "_circle" '(10 10 0) 1 "")
(command "_rectangle" '(0 0 0) "_Dimension" 4 5 "")
(command "_rectangle" '(10 10 0) "_Dimension" 4 5 "")

(princ) ;;clean exit
)

Share this post


Link to post
Share on other sites
pBe

(command "_rectangle" '(0 0 0) "_Dimension" 4 5[b] ""[/b])

 

command is waiting for input after "Specify width for rectangles : 5 prompt

Its either you replace the "" symbol with "\\" or pause for input

 

(command "_rectangle" '(0 0 0) "_Dimension" 4 5 "\\")

 

or provide a point list

 

(command "_rectangle" '(0 0 0) "_Dimension" 4 5 '(10 10 0) )

 

to place the rectangle of the first quadrant [right upper corner] as coordinate '(10 10 0.0) is north east of the rectangles first point

 

or even

 

(command "_rectangle" '(0 0 0) "_Dimension" 4 5 (polar '(0 0 0)  (* pi 0.25) 1))

 

HTH

 

And Welcome to the Forum neko_Designer

Edited by pBe

Share this post


Link to post
Share on other sites
MSasu

Please pay also attention that all your command calls have an extra (the "") at their end.

(command "_thickness" 1 [color=red]""[/color])
(command "_circle" '(0 0 0) 1 [color=red]""[/color])
(command "_circle" '(10 10 0) 1 [color=red]""[/color])
(command "_rectangle" '(0 0 0) "_Dimension" 4 5 [color=red]""[/color])

 

Another potential source of errors will come from active OSNAP modes - need to disable them before inputting points:

(command [color=red]"_non"[/color] "_circle" '(0 0 0) 1)

Share this post


Link to post
Share on other sites
Tharwat

Another potential source of errors will come from active OSNAP modes - need to disable them before inputting points:

(command [color=red]"_non"[/color] "_circle" '(0 0 0) 1)

 

I guess the OSNAP mode should be before the insertion point and not before the command name ;)

Share this post


Link to post
Share on other sites
neko_designer

thanks everyone, you guys are great

Share this post


Link to post
Share on other sites
neko_designer

Any idea why this doesn't work either?

 

(command "_arc" "_Center" '(0 0 0) '(1 0 0) '(0 1 0) "")?

 

I'm trying to create an arc only on the first quadrant on this case. In general, I have two points as well as the center point where I want it located and want to generate the arc

 

I could also work with angles of beginning and end of the arc and the center point.

 

I really appreciate any suggestions.

Share this post


Link to post
Share on other sites
Tharwat

Try this ...

(command "_arc" "_C" "_none" '(0 0 0) "_none" '(1 0 0) "_none" '(0 1 0))

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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