Results 1 to 4 of 4

Thread: How to Stop the Routine

  1. #1
    AUGI Addict
    Join Date
    2006-04
    Location
    (0,0,+|Z|)
    Posts
    1,119

    Default How to Stop the Routine

    Hi ALL,
    The following is a sample of a routine structure:

    Code:
    (defun c:TEST (/ A1 A2 A3)
    (MODULE 1)
    (MODULE 2)
    (MODULE 3)
    (MODULE 4)
    ; the routine would continuously jump to MODULE 6 if MODULE 5 is not executed.
    (MODULE 5)
    ; the routine should stop without MODULE 6 running if MODULE 5 is executed.
    (MODULE 6)
    ); end of defun
    I don't see a "IF" statement can simply apply to this routine because each module contains several commands/functions.

    Your helps are much appreciated.
    Thanks in advance.
    Last edited by BoKirra; 2009-03-04 at 04:20 AM.

  2. #2
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,519

    Default Re: How to Stop the Routine

    Whatever determines if module 5 should run becomes "condition" below...

    Code:
    
    
    (if condition
      (module 5)
      (module 6)
    )
    
    
    

  3. #3
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Hartford, Michigan
    Posts
    3,086

    Default Re: How to Stop the Routine

    and if (module 5) is actually a program written out, you would have to inclose it with (progn)
    Christopher T. Cowgill, P.E.
    WIGHTMAN & ASSOCIATES, INC.
    ENGINEERING <> SURVEYING <> ARCHITECTURE
    AutoDesk Infrastructure Design Suite Premium 2013 x64
    Windows 7 Pro x64

  4. #4
    AUGI Addict
    Join Date
    2006-04
    Location
    (0,0,+|Z|)
    Posts
    1,119

    Default Re: How to Stop the Routine

    Quote Originally Posted by rkmcswain View Post
    Whatever determines if module 5 should run becomes "condition" below...

    Code:
    (if condition
    (module 5)
    (module 6)
    )
    A small but great tip!
    Thanks to both of you.

Similar Threads

  1. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 11:14 AM
  2. Stop a routine midstream
    By M. Kubitza in forum AutoLISP
    Replies: 9
    Last Post: 2010-04-20, 08:23 PM
  3. Replies: 9
    Last Post: 2007-06-13, 01:22 PM
  4. Replies: 2
    Last Post: 2007-04-20, 09:51 AM
  5. Does it ever stop??
    By rod.74246 in forum Revit Architecture - General
    Replies: 11
    Last Post: 2005-07-24, 02:23 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
  •