# Thread: how to write a program to get the lines like in the attachment

1. ## how to write a program to get the lines like in the attachment

Registered forum members do not see this ad.

hi i'm very new to autolisp i'm leraning programming now-a-days,if we draw two circles with same center point and with different radius by using polararray how can we draw lines on the circle at different angles from 0 to 360degrees from the same center.If you help me it is very useful to me
Thanks

2. You should look to POLAR function; it will take the angle argument in radians. Example of drawn from origin a 5 units line at 35 degrees:
Code:
`(command "_LINE" '(0 0) (polar '(0 0) (* (/ 35.0 180.0) pi) 5.0) "")`

3. thanks for your reply,i'm getting that but it is not i wanted ,actually what i wanted is to draw 12 lines on two circles with 30degrees each at a time by using a program,can you help me to do that

Thanks.

4. Originally Posted by aswini
thanks for your reply,i'm getting that but it is not i wanted ,actually what i wanted is to draw 12 lines on two circles with 30degrees each at a time by using a program,can you help me to do that
Then, since you 'get' what Mircea was kind enough to point out (to use the Polar LISP Function), simply repeat the process 12 times (to generate 12 lines), using your 30 degree increment each time in your own custom program.

5. hmm thanq i thought of that but it is becoming lenghty program.

6. ## how to repeat the lines by using autolisp

If i draw a rectangle in the middle of two circles like in the attachment ,then how to repeat them around the circle with different angles.can anyone help me plz
Thanks

7. Moderator This is basicly the same question as the other post.

Good time to learn lisp in particular LINE pt1 pt2 & Polar & Entsel

8. Moderator is this post 3 of the same question ? http://www.cadtutor.net/forum/showth...the-attachment

Re lengthy you have not scratched the surface in HOW MANY LINES OF CODE.

Also in your first post was the lines meant to go from the centre of the circle ?

9. Code:
`(command "array" "P" "0,0" "14" "360" "Y")`
There is a start:

Type:
Code:
`(command "array")`
This will go through the options

10. Registered forum members do not see this ad.

Originally Posted by aswini
becoming lenghty program.
It will not if you will use REPEAT and increment the angle at each draw, instead of having one line of code for each item to be drawn.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts