+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23
  1. #1
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    7

    Smile 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
    Last edited by aswini; 23rd May 2012 at 09:18 pm.

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,953

    Default

    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) "")
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    7

    Default

    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. #4
    Forum Deity BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    256GB SSD
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Using
    Civil 3D 2015
    Join Date
    Nov 2009
    Posts
    4,746

    Default

    Quote Originally Posted by aswini View Post
    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.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD® 2014, and Civil 3D® 2014 Certified Professional | Autodesk® Authorized Developer
    Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

  5. #5
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    7

    Default

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

  6. #6
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    7

    Default 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
    Attached Files

  7. #7
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,329

    Default

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

    Good time to learn lisp in particular LINE pt1 pt2 & Polar & Entsel
    A man who never made mistakes never made anything

  8. #8
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,329

    Default

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

    http://www.cadtutor.net/forum/showth...using-autolisp

    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 ?
    Last edited by BIGAL; 24th May 2012 at 09:40 am.
    A man who never made mistakes never made anything

  9. #9
    Senior Member
    Using
    AutoCAD 2015
    Join Date
    Sep 2010
    Location
    New Zealand
    Posts
    217

    Default

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

    Type:
    Code:
    (command "array")
    This will go through the options
    Last edited by SLW210; 24th May 2012 at 01:04 pm.

  10. #10
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,953

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by aswini View Post
    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.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

Similar Threads

  1. how to write 2 foreach loops in a program
    By gvgbabu in forum AutoLISP, Visual LISP & DCL
    Replies: 19
    Last Post: 15th Apr 2011, 07:17 pm
  2. how to write lisp program
    By srinu_vasu38 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 17th Apr 2010, 10:09 am
  3. Jpg attachment
    By aravindkpe in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 3
    Last Post: 3rd Aug 2009, 06:42 am
  4. Autolisp program to generate grid lines
    By skipo4us in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 25th Mar 2008, 07:49 pm

Bookmarks

Posting Permissions

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