Jump to content

beginner - code help


neko_designer
 Share

Recommended Posts

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
)

Link to comment
Share on other sites

(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
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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.

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

 Share

×
×
  • Create New...