Results 1 to 3 of 3

Thread: DCL LISP routine to call different functions

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

    Default DCL LISP routine to call different functions

    Hello everyone, I am attempting to have my lisp routine calling a dcl dialog box to execute a different function depending on which slide is selected by the user.
    Currently, there is only 1 trim length that the lisp is using, regardless of my attempts to have it do otherwise. I know my issue is within the (action_tile) and if I could find someone to assist in getting this correct for us I would be incredibly grateful. Thank you in advance, and now let's see the code.:

    Code:
          (action_tile "Slide12" 
           "(progn
               (setq Return$ Slide12$)(setq doAction 'T)
               (done_dialog)
            )"
         )
      
    
    (action_tile
        "cancel"
          "(done_dialog) (setq doAction nil)")
              
    
       (start_dialog)
    
       (unload_dialog Dcl_Id%)
    (if doAction (SmallVLVInsert))
       (princ)
    
    );defun c:Smallvalves
      
    
    (done_dialog)
    
    (defun SmallVLVInsert ( / ss p2 p3)
    (done_dialog)
    (command "attreq" "0")
    (if (eq 16384 (logand 16384 (getvar "osmode")))
    (setvar "OSMODE" (boole 6 (getvar "OSMODE") 16384)))
    (command "snap" "0.0625")
    (setq insertpt1 (getpoint "\nPick Insertion Point on line: "))
    
    (if (not (tblsearch "layer" "pid"))
      (entmake
        (list
          (cons 0 "Layer")
          (cons 100 "AcDbSymbolTableRecord")
          (cons 100 "AcDbLayerTableRecord") 
          (cons 2 "pid")
          (cons 70 0)
          (cons 62 3)
          (cons 6 "Continuous")
        )
      )
    )
    
    (setq Snap (getvar "osmode"))
    	     
    (setvar "clayer" "pid")
    
    (command "_insert" Return$ insertpt1 "" "" "")
    
    (while (not ss)
      (setq ss (entsel "\nSelect line to break: "))
      );while
      ;(while (not p3)
    
    
       (setvar 'osmode 613)
    
       (setq p3 (getpoint "\nPick valve center:")
             p2 (angle p3 (cadr ss))
       )
    
     
    (command "break" ss "f" (polar p3 p2 0.093750)
                            (polar p3 p2 -0.093750))
    
      (setvar "cmdecho" 1)
    
      (princ)
    
      (setvar "osmode" Snap)
    
    );if

    Only a small excerpt but I believe it illustrates my problem well enough.
    If I were to want to add a 2nd function below the last closing bracket ");if",
    then it seems as if the routine only sees the first function and will trim the line around the selected block the distances specified in the first defun SmallVlvInsert. I would like to add a FlanSmlValveInsert that trims to .1172 instead of the 0.093750 that is in the SmallVlvInsert, but trims in the same way because it works fine and good. Of course any upgrades or error checking would be gratefully accepted and placed into this code.

    Thank you

  2. #2
    Active Member
    Join Date
    2013-07
    Posts
    66
    Login to Give a bone
    0

    Default Re: DCL LISP routine to call different functions

    Hi again, I will attach the corresponding lisp and dcl files so that anyone may take a look at the code in full.

    Thanks again.
    Attached Files Attached Files

  3. #3
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,114
    Login to Give a bone
    0

    Default Re: DCL LISP routine to call different functions

    Here is an example of using slides and image tiles.

    Take a look...

    It isn't that complicated.

    Ask if you have trouble.

    P=
    Attached Files Attached Files
    AutomateCAD

Similar Threads

  1. Replies: 9
    Last Post: 2012-01-21, 07:58 AM
  2. Call MDDEDIT from a Lisp Routine
    By JeffClark in forum AutoCAD Customization
    Replies: 5
    Last Post: 2010-08-25, 08:47 PM
  3. Does this call for a lisp routine?
    By behrooz.mirfathali in forum AutoLISP
    Replies: 5
    Last Post: 2008-11-04, 03:10 PM
  4. Replies: 4
    Last Post: 2005-12-06, 04:17 PM
  5. How is your computer set up to call a LISP routine?
    By jack.frahm in forum AutoLISP
    Replies: 6
    Last Post: 2005-02-18, 01:52 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
  •