AutoCAD AutoLisp Programming, need a little help - FirebirdV6.com/CamaroV6.com Message Board

Announcement

Collapse
No announcement yet.

AutoCAD AutoLisp Programming, need a little help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AutoCAD AutoLisp Programming, need a little help

    Ok peoples, here's the thing. We have to make a program (a rather stupid one at that) to draw a triangle with two circles attached. The center point of the circles are the points at the end of the base of the triangle. The user inputs both radius's, the starting point (center of 1st circle), the length to the center of the 2nd circle, and the angle from the start, to the top of the triangle (point 3).

    Here's what I've got so far:

    (defun tan (angle)
    (/ (sin angle) (cos angle))
    )

    (defun dtor (angle)
    (/ (* angle pi) 180)
    )

    (defun C:4ctri(/ R1 R2 P1 L A H)
    (setq R1 (getdist "\ Enter Radius of 1st Circle: "))
    (setq R2 (getdist "\ Enter Radius of 2nd Circle: "))
    (setq P1 (getpoint "\ Enter Center Point of 1st Circle: "))
    (setq L (getdist "\ Enter Length to Center of 2nd Circle: "))
    (setq A (getangle "\ Specify the Angle: "))
    (setq H (* (/ L 2) (tan (dtor A))))
    (setq X1 (car P1))
    (setq Y1 (cadr P1))
    (setq X2 (+ X1 L))
    (setq Y2 Y1)
    (setq P2 (List X2 Y2 0))
    (setq X3 (+ X1 (/ L 2)))
    (setq Y3 (+ Y1 H))
    (setq P3 (List X3 Y3 0))
    (command "line" P1 P2 P3 "c")
    (command "circle" P1 R1)
    (command "circle" P2 R2)
    )

    I think my problem is somewhere in getting my height. The program takes all the user inputs, and draws both circles and the base correctly, but that's where I get problems. Does anybody have any ideas on where I went wrong?
    ~Chris<br />1999 Hugger Orange Camaro<br /> <a href=\"http://www.cardomain.com/ride/273836\" target=\"_blank\">http://www.cardomain.com/ride/273836</a> <br /><br />†…faith…hope

  • #2
    AutoLisp Programming... is this how people determined that Homosexuals are born with a propensity towards the same sex? [img]tongue.gif[/img] No offense to our members who swing that way... ;)
    Check out my stable of supercharged W-Bodies <a href=\"http://www.fullthrottlev6.com/forums/vbgarage.php?do=view&id=136\" target=\"_blank\">HERE</a><br /><b>\'97 Pontiac GP GTP Coupe</b><br /><b>\'98 Regal GS | L67 3800 Series II</b>

    Comment


    • #3
      Dude, Just get a normal AutoCad box write you name on it and hand it in.

      A+ work.
      \'96 A4 Camaro 3800<br />Nothing but... <br />Flowmaster 40 series

      Comment


      • #4
        Well, those responses were about useless. Thanks for nothing. :rolleyes:

        Originally posted by L32Projekt:
        AutoLisp Programming... is this how people determined that Homosexuals are born with a propensity towards the same sex? [img]tongue.gif[/img] No offense to our members who swing that way... ;)
        Hahahahaha, but seriously
        AutoLISP is part of AutoCAD. You can use it to make programs for AutoCAD, to make drawings easier, or making your own toolbars and crap.

        Originally posted by ThatsMeGC:
        Dude, Just get a normal AutoCad box write you name on it and hand it in.

        A+ work.
        My assignment is to make a program that draws a triangle with a circle on each end of the base. It has to run, and I have AutoCAD 2002 for this class. The program runs most of the way.

        Anybody have anything useful to add?
        ~Chris<br />1999 Hugger Orange Camaro<br /> <a href=\"http://www.cardomain.com/ride/273836\" target=\"_blank\">http://www.cardomain.com/ride/273836</a> <br /><br />†…faith…hope

        Comment


        • #5
          Originally posted by silvachris1:

          Anybody have anything useful to add?
          Sure.

          What did you expect when you post on a car board? You've been around long enough, should've expected it. Try asking on an AutoCAD site.
          Matt
          1998 Mystic Teal Camaro M5
          Whisper Lid, Pacesetter Headers, Catco Cat, Dynomax Super Turbo, B&M Shifter, BMR STB, LSD, P&P Intakes, GT2 Cam, Comp OE Lifters, 1.7 Roller Rockers, Pushrods, SSM Heads, DHP PowrTuner.

          Comment


          • #6
            Yeah, I know my post wasn't helpful in the least and I apoligize for that. If I had any real knowledge I'd have chimed in but I don't. Sorry for polluting your thread. ;)
            Check out my stable of supercharged W-Bodies <a href=\"http://www.fullthrottlev6.com/forums/vbgarage.php?do=view&id=136\" target=\"_blank\">HERE</a><br /><b>\'97 Pontiac GP GTP Coupe</b><br /><b>\'98 Regal GS | L67 3800 Series II</b>

            Comment


            • #7
              gotta agree... you probably won't get too many responses of people who know what they're talking about.

              1. not that many people on this site use autocad.
              2. autolisp programming is used by machinists mostly... but the bulk of autocad licenses are sold for land development.

              i guess what i was waiting for was a little more clarification of what exactly the problem is. i'm guessing the program only works with right triangles?

              Comment


              • #8
                I know how to use autocad...but not autolisp.

                I was simply making a joke that autocad is a program that does what you need so just pass it off as your own program.
                \'96 A4 Camaro 3800<br />Nothing but... <br />Flowmaster 40 series

                Comment


                • #9
                  Originally posted by ThatsMeGC:
                  I know how to use autocad...but not autolisp.

                  I was simply making a joke that autocad is a program that does what you need so just pass it off as your own program.
                  It doesn't work quite that easy.

                  Originally posted by RallyRed 98:
                  gotta agree... you probably won't get too many responses of people who know what they're talking about.

                  1. not that many people on this site use autocad.
                  2. autolisp programming is used by machinists mostly... but the bulk of autocad licenses are sold for land development.

                  i guess what i was waiting for was a little more clarification of what exactly the problem is. i'm guessing the program only works with right triangles?
                  Nah, this stupid thing is supposed to draw an isosceles triangle. The top point is supposed to be centered over the center of the base.

                  Yeah, I know not too many people on here would know what to respond about, but I'm hoping somebody would know. There are alot of people on this board who are going for an Engineering Degree, so I hoped this wouldn't be too much of a problem. As of Friday, my Professor couldn't even find the problem.

                  Originally posted by L32Projekt:
                  Yeah, I know my post wasn't helpful in the least and I apoligize for that. If I had any real knowledge I'd have chimed in but I don't. Sorry for polluting your thread. ;)
                  Well, your response was pretty funny. I just got a little worked up over this. I've got like 3 other projects due Monday, along with an exam, so I was hoping for any kind of help at all.

                  Originally posted by 98Camaro3.8:
                  What did you expect when you post on a car board? You've been around long enough, should've expected it. Try asking on an AutoCAD site.
                  Yeah, like I said, I wasn't expecting much. I've seen people post and get help with C++ programming, and get help with MATLab, so I was hoping for help too.

                  Anywho, now that I've got some of my other projects done, I'm not as stressed. Guys, I'm sorry for gettin a little torqued up over all that. I shoulda taken it less serious. Thanks for responding anyways guys.
                  ~Chris<br />1999 Hugger Orange Camaro<br /> <a href=\"http://www.cardomain.com/ride/273836\" target=\"_blank\">http://www.cardomain.com/ride/273836</a> <br /><br />†…faith…hope

                  Comment

                  Latest Topics

                  Collapse

                  There are no results that meet this criteria.

                  FORUM SPONSORS

                  Collapse
                  Working...
                  X