Results 1 to 10 of 10

Thread: autolisp help

  1. #1
    Active Member
    Join Date
    2008-05
    Posts
    66
    Login to Give a bone
    0

    Default autolisp help

    (DEFUN C:Gq (/)
    (GRAPHSCR) ; CHANGE TO GRAPHIC SCREEN
    (SETQ L ( GETREAL" ENTER LENGTH OF GASKETS " )) (terpri)

    (setq cog ( getpoint " enter corner of gasket " )) (terpri)
    (setq cod (getpoint " test point "))(terpri)
    (setq x1 (car cog )) (terpri)
    (setq y1 (cadr cog )) (terpri)
    (setq z1 (caddr cog))(terpri)


    (setq x2 (+ x1 L))(terpri)
    (setq x3 (+ x1 L))(terpri)
    (setq x4 (+ x1 0))(terpri)
    (setq x5 (+ x1 ))(terpri)


    (setq y2 (+ y1 0))(terpri)
    (setq y3 (+ y1 L))(terpri)
    (setq y4 (+ y1 L))(terpri)
    (setq y5 (+ y1 L))(terpri)

    (setq z2 (+ z1 0))(terpri)
    (setq z3 (+ z1 0))(terpri)
    (setq z4 (+ z1 0))(terpri)
    (setq z5 (+ z1 L))(terpri)

    (setq pnt1 (list x2 y2 z2))(terpri)
    (setq pnt2 (list x3 y3 z3))(terpri)
    (setq pnt3 (list x4 y4 z4))(terpri)
    (setq pnt4 (list x5 y5 z5))(terpri)


    (command "line" cog pnt1 pnt2 pnt3 pnt4 "") (terpri)
    (command "pedit" "m" (ssget)"""y""j""""")(terpri)


    hi

    i got program above, i need to add extrude command to the line to dimension same as length.
    (command "extrude"""(???)"" (????) what i need to put here when it ask select object and height as well.
    thanks you
    please help

    sam

  2. #2
    I could stop if I wanted to
    Join Date
    2005-08
    Location
    Albania
    Posts
    423
    Login to Give a bone
    0

    Default Re: autolisp help

    Quote Originally Posted by sam_ctlim View Post
    (DEFUN C:Gq (/)
    (GRAPHSCR) ; CHANGE TO GRAPHIC SCREEN
    (SETQ L ( GETREAL" ENTER LENGTH OF GASKETS " )) (terpri)

    (setq cog ( getpoint " enter corner of gasket " )) (terpri)
    (setq cod (getpoint " test point "))(terpri)
    (setq x1 (car cog )) (terpri)
    (setq y1 (cadr cog )) (terpri)
    (setq z1 (caddr cog))(terpri)


    (setq x2 (+ x1 L))(terpri)
    (setq x3 (+ x1 L))(terpri)
    (setq x4 (+ x1 0))(terpri)
    (setq x5 (+ x1 ))(terpri)


    (setq y2 (+ y1 0))(terpri)
    (setq y3 (+ y1 L))(terpri)
    (setq y4 (+ y1 L))(terpri)
    (setq y5 (+ y1 L))(terpri)

    (setq z2 (+ z1 0))(terpri)
    (setq z3 (+ z1 0))(terpri)
    (setq z4 (+ z1 0))(terpri)
    (setq z5 (+ z1 L))(terpri)

    (setq pnt1 (list x2 y2 z2))(terpri)
    (setq pnt2 (list x3 y3 z3))(terpri)
    (setq pnt3 (list x4 y4 z4))(terpri)
    (setq pnt4 (list x5 y5 z5))(terpri)


    (command "line" cog pnt1 pnt2 pnt3 pnt4 "") (terpri)
    (command "pedit" "m" (ssget)"""y""j""""")(terpri)


    hi

    i got program above, i need to add extrude command to the line to dimension same as length.
    (command "extrude"""(???)"" (????) what i need to put here when it ask select object and height as well.
    thanks you
    please help

    sam
    Why you use a lot of variable (terpri)

  3. #3
    Active Member
    Join Date
    2008-05
    Posts
    66
    Login to Give a bone
    0

    Default Re: autolisp help

    Quote Originally Posted by Arben.Allaraj View Post
    Why you use a lot of variable (terpri)
    Actually i just got no idea why i was used the too many (terpri).
    so would you able to help me extrude the line in this program. please
    i'm beginner autolisp. i wish to learn....

    thanks

    sam

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

    Default Re: autolisp help

    Try this.
    Code:
    (DEFUN C:Gq (/ GasketLength GasketLL GasketUR)
      (GRAPHSCR)				; CHANGE TO GRAPHIC SCREEN
      (setq	GasktetLength (GETREAL " ENTER LENGTH OF GASKETS ")
    	GasketLL      (getpoint " enter corner of gasket ")
    	GasketUR      (list (+ (car GasketLL) GasketLength)
    			    (+ (cadr GasketLL) GasketLength)
    			    (caddr GasketLL)
    		      )
      )
      (command "_rectang" GasketLL GasketUR)
      (command "_extrude" (entlast) "" GasketLength)
    )
    After you study and understand this code for a bit, please ask future AutoLISP questions in the AutoLISP forum. However, please continue discussing this code sample in this thread. We will have it moved for you.
    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

  5. #5
    Active Member
    Join Date
    2008-05
    Posts
    66
    Login to Give a bone
    0

    Default Re: autolisp help

    Hi thanks for help,,,

    i had tried to run program but it doest'nt work.

    but i tried to put ((command "_extrude" (entlast) "" number of length) then it work.


    can i ask what is the purpose to use (entlast) function??

    Thanks

    #
    SAM

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

    Default Re: autolisp help

    Entlast selects the last entity in the drawing. For further explanation, please see the Developer Help file which is included with AutoCAD.
    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

  7. #7
    Active Member
    Join Date
    2008-05
    Posts
    66
    Login to Give a bone
    0

    Default Re: autolisp help

    hi

    thanks for help

    if let say i got two entity on the screen then i just wan to extrude one of them.

    what should i write into program?

    i was download the augi autolisp program (ATP 164 segment 1, 2 AND 3) )but i din see the (entlast) function, so do u know any more complete tutorial can i get?
    Thanks

    SAM

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

    Default Re: autolisp help

    Try the sticky threads in the AutoLISP forum.
    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
    Active Member
    Join Date
    2008-05
    Posts
    66
    Login to Give a bone
    0

    Default Re: autolisp help

    hi


    what autolisp forum? i tried before but could'nt find from augi website?

    SAM

  10. #10
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: autolisp help

    Quote Originally Posted by sam_ctlim View Post
    hi


    what autolisp forum? i tried before but could'nt find from augi website?

    SAM
    click on the word AutoLISP in Opie's post, it will take you there.

Similar Threads

  1. AutoLISP
    By dderr368271 in forum AutoLISP
    Replies: 13
    Last Post: 2014-03-06, 10:46 AM
  2. Autolisp
    By thechinaman in forum AutoCAD General
    Replies: 7
    Last Post: 2011-05-23, 04:07 AM
  3. Autolisp
    By bulalakaw80 in forum AutoCAD Customization
    Replies: 6
    Last Post: 2007-11-15, 07:32 PM
  4. AutoLisp or VBA
    By red2002yzfr1 in forum ACA General
    Replies: 6
    Last Post: 2006-05-22, 02:36 PM
  5. autolisp help
    By guyogordo in forum AutoLISP
    Replies: 9
    Last Post: 2004-09-20, 12:15 AM

Posting Permissions

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