Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PLASE HELP MEEE!!!

  1. #1
    Member
    Join Date
    2011-06
    Posts
    4
    Login to Give a bone
    0

    Default PLASE HELP MEEE!!!

    Hello i have a problem, I need to make project in autocad.
    The drawing is simple but my problem is autolisp. I barelly understand autolisp and our teacher doesn't really explain anything (sometimes I think that he himself doesn't know how to do it) . What do I have to do? I have 1 drawing with entmake function. This is a example, plase hellp meee!!


    Code:
    (defun desen ()
      (setq latime (getreal "\nDati latimea: "))
      (while (< latime 0.)
        (setq latime (getreal "\nDati o valoare pozitiva: "))
        )
    
      ;cota2
      (setq val_min (* 1.8 latime))
      (setq val_max (* 2.2 latime))
      (princ "\nDati lungimea ( ")
      (princ val_min)
      (princ " .. ")
      (princ val_max)
      (princ " ):")
      (setq lungime (getreal))
      (while (< lungime val_min)
        (setq lungime (getreal "\nDati o valoare mai mare decat valoarea minima: "))
        )
      (while (> lungime val_max)
        (setq lungime (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
        )
    
      ;cota3
      (setq val_min (* 0.4 latime))
      (setq val_max (* 0.6 latime))
      (princ "\nDati inaltimea ( ")
      (princ val_min)
      (princ " .. ")
      (princ val_max)
      (princ " ):")
      (setq inaltime (getreal))
      (while (< inaltime val_min)
        (setq inaltime (getreal "\nDati o valoare mai mare decat valoarea minima: "))
        )
      (while (> inaltime val_max)
        (setq inaltime (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
        )
      
      ;cota4
      (setq val_min (* 0.3 latime))
      (setq val_max (* 0.5 latime))
      (princ "\nDati diametrul cilindrului ( ")
      (princ val_min)
      (princ " .. ")
      (princ val_max)
      (princ " ):")
      (setq diam (getreal))
      (while (< diam val_min)
        (setq diam (getreal "\nDati o valoare mai mare decat valoarea minima: "))
        )
      (while (> diam val_max)
        (setq diam (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
        )
    
      (command "osnap" "off")
      (command "vpoint" "-1,-1,1")
      (command "Color" "blue")
      
    ;;;  (setq latime 62)
    ;;;  (setq lungime 106)
    ;;;  (setq inaltime 37)
    ;;;  (setq diam 25)
      
      (setq raza (/ diam 2))
      (setq b1 (list 0. 0. ))
      (setq b2 (list lungime 0))
      (setq b3 (list lungime latime))
      (setq b4 (list 0 latime))
      
      (setq t1 (list (*(/ 80. 62) latime) 0))
      (setq t2 (list (*(/ 80. 62) latime) latime))
      
      (setq v1 (list (*(/ 88. 62) latime) 0))
      (setq v2 (list (*(/ 88. 62) latime) latime))
    
      (setq c1 (list latime (/ latime 2)))
      (setq r1 (*(/ 12.5 62.) latime))
      
      (entmake (list (cons 0 "polyline")
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 b1)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 b2)
             )
           )
        (entmake (list (cons 0 "vertex")
             (cons 10 b3)
               )
             )
      (entmake (list (cons 0 "vertex")
             (cons 10 b4)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 b1)
             )
           )
      (entmake (list(cons 0 "SEQEND")
            )
           )
      (setq baza (entlast))
    
      (entmake (list (cons 0 "polyline")
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 t1)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 b2)
             )
           )
        (entmake (list (cons 0 "vertex")
               (cons 10 b3)
               )
             )
      (entmake (list (cons 0 "vertex")
             (cons 10 t2)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 t1)
             )
           )
      (entmake (list(cons 0 "SEQEND")))
      (setq treapta (entlast))
    
      (entmake (list (cons 0 "polyline")
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 v1)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 b2)
             )
           )
        (entmake (list (cons 0 "vertex")
             (cons 10 b3)
               )
             )
      (entmake (list (cons 0 "vertex")
             (cons 10 v2)
             )
           )
      (entmake (list (cons 0 "vertex")
             (cons 10 v1)
             )
           )
      (entmake (list(cons 0 "SEQEND")))
      (setq varf (entlast))
    
      (command "Color" "yellow")
      (entmake (list (cons 0 "circle")
           (cons 10 c1)
           (cons 40 r1)
             )
           )
      (setq cili (entlast))
      
      (command "Color" "blue")
      (command "extrude" baza "" (*(/ 18. 62) latime) "" 0 "")
      (setq baza (entlast))
      (command "extrude" treapta "" (*(/ 25. 62) latime) "" 0 "")
      (setq treapta (entlast))
      (command "extrude" varf "" inaltime "" 0 "")
      (setq varf (entlast))
      (command "Color" "yellow")
      (command "extrude" cili "" inaltime "" 0 "")
      (setq cili (entlast))
      (command "subtract" baza "" cili "" )
      (command "Color" "blue")
      (command "union" baza treapta varf "")
      (command "zoom" "a")
      (command "ShadeMode" "o")
      )
    (defun c:pr ()
      (desen)
      )
    (defun c:s ()
      (command "undo" 200)
      )



    plase help mee
    i attach pictures with my project plase is URGENT.
    Attached Images Attached Images
    Last edited by Opie; 2011-06-22 at 01:46 AM. Reason: [code] tags added to disable smilies in posted code

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    A few questions/suggestions:
    1. Are you sure you want to create the old "heavyweight" polylines? Why not use the new LWPOLYLINE?
    2. Rather than send a command to change system variables, use setvar.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  3. #3
    Member
    Join Date
    2011-06
    Posts
    4
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    This is way my teacher whant is comlicate this way he teach us to do it

  4. #4
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    What is being taught - drafting, coding, or design?
    If you are going to fly by the seat of your pants, expect friction burns.
    Some say beauty is in the eye of the Beholder... perhaps so, but I've only seen the disintegration beam.
    Everyone else being wrong is not the same thing as being right.

  5. #5
    Member
    Join Date
    2011-06
    Posts
    4
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    the coding of the designe

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    Quote Originally Posted by ynux_ynux522051 View Post
    the coding of the designe
    Trying *really* hard not to be snotty about this, but isn't the point of assignments to do your own work?
    If you are going to fly by the seat of your pants, expect friction burns.
    Some say beauty is in the eye of the Beholder... perhaps so, but I've only seen the disintegration beam.
    Everyone else being wrong is not the same thing as being right.

  7. #7
    Member
    Join Date
    2011-06
    Posts
    4
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    is hard for me lisp ....because the teacher is not expline to us to under stand

  8. #8
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,483
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    Quote Originally Posted by dgorsman View Post
    Trying *really* hard not to be snotty about this, but isn't the point of assignments to do your own work?
    Apparently, this is not the only new AUGI member with this teacher.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #9
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    Quote Originally Posted by Opie View Post
    The similarities and exact same line about the teacher did not escape me, hence the more forward question this time.
    If you are going to fly by the seat of your pants, expect friction burns.
    Some say beauty is in the eye of the Beholder... perhaps so, but I've only seen the disintegration beam.
    Everyone else being wrong is not the same thing as being right.

  10. #10
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,483
    Login to Give a bone
    0

    Default Re: PLASE HELP MEEE!!!

    Quote Originally Posted by ynux_ynux522051 View Post
    is hard for me lisp ....because the teacher is not expline to us to under stand
    What exactly is the hard part? There are a few extra responses to some commands which are giving you some errors. But for the most part, your code works to completion.

    Is there anything in your code that you could improve on? Are there things that you are doing repetitively? I would suggest you break your code down in to pieces. If you find there are things there that are done repeatedly, break those steps out into their own function.

    In your code, you request a real value four times. Three of those, you ask for a value within a calculated range. Could you break this out into it's own function?

    Later, you are making three polylines. Doing this, are you not repeating steps you have done already? You could break this out into it's own function.

    So I would suggest you write out your function in your native speaking language and not in code. Once you have those steps, work out each step to get the desired results. Once these individual steps are working, bring them into your main function.

    Now, if you have trouble with a particular step, then ask away. I'm certain someone will come along on here and help you out with a little nudge of advice or even possibly the entire code.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Page 1 of 2 12 LastLast

Similar Threads

  1. plase help???????????????????????
    By ahmad.biloune in forum Survey - General
    Replies: 1
    Last Post: 2008-08-13, 01:39 PM

Posting Permissions

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