Results 1 to 7 of 7

Thread: Joining 2 Auto Lisp together please

  1. #1
    Member
    Join Date
    2008-10
    Posts
    10
    Login to Give a bone
    0

    Unhappy Joining 2 Auto Lisp together please

    I have these 2 autolisp

    Code:
    (defun c:18BK (/ pt rad)
      (if (and (setq pt (getpoint "\nPoint: "))
               (setq rad "12.0"))
        (CirBrk pt rad))
      (princ)
    )
    and this one:

    Code:
    (DEFUN c:ivfrt	(/ sc clay)
      (setvar "cmdecho" 0)
      (COMMAND "INSERT"
    	   "*ivfrt.dwg"
    	   "S"
    	   (SETQ sc (GETVAR "dimscale"))
    	   (GETPOINT) pause)
    	   pause
      ) ;_ end of command
    into a single Autolisp call "ivfrt"

    but I can make them work together 18bk first then ivfrt next in the same autolisp
    the idea is once I type "ivfrt" I select the line to break as soon as I finish this command the insert block command is next.

    Please any body can help me in this one

    Thank you very much
    Last edited by rkmcswain; 2017-09-27 at 11:56 AM. Reason: added [CODE] tags

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    A C: defun can be called the same way as a defun in your code (C:18Bk) no need to type it.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    When posting code click [Go Advanced] button on bottom right then click the # button in the toolbar up top and paste the code inside.

    The function "CirBrk" isn't defined anywhere, odd that it uses a string "12.0" rather than a real 12.0?
    If you're going with "12.0" anyway I'd simplify to
    Code:
    (CirBrk pt "12.0")
    and
    Code:
    (if (setq pt (getpoint "\nPoint: "))(COMMAND "._INSERT" "*ivfrt.dwg" pt (GETVAR "dimscale")))

  4. #4
    Member
    Join Date
    2008-10
    Posts
    10
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    I am sorry, BIG-AL
    I need to type so I can insert a symbols "18bk" is an action to break the line 1'-6", then the Insert "ivfrt" the Valve Flange right side in the same area (18bk) open before insert.
    I can do this in 2 separated times with typing this 2 separate AutoLISP, but I would like to put it together where I type only one time ivfrt and to 18bk any more.
    I add the file I call ALAN2.LSP where if I type Alan2, then the 2 autolisp work as one.
    can you make them work please feel free to download it and test it
    I hope I made my self understandable, thanks

    - - - Updated - - -

    Tom.
    Thanks for your response see my last comment with the file attached see if it can be modify to make it work that way need it
    Attached Files Attached Files

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    Try (assuming the function "CirBrk" is defined someplace we haven't seen):
    Code:
    (defun c:18BK (/ pt rad)
      (if(setq pt(getpoint "\nPoint: "))(CirBrk pt "12.0"))
      (princ)
    )
    (DEFUN c:ivfrt	(/ sc clay)
      (setvar "cmdecho" 0)
      (if (setq pt (getpoint "\nPoint: "))
    	(COMMAND "._INSERT" "*ivfrt.dwg" pt (GETVAR "dimscale"))
      )
      (C:18Bk); what BIG-AL means
    ) ;_ end of command

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    Quote Originally Posted by Tom Beauford View Post
    When posting code click [Go Advanced] button on bottom right then click the # button in the toolbar up top and paste the code inside.
    Or you can just surround your code text with [CODE] [/CODE] tags. For example:

    [CODE]
    (defun c:fun ()
    (subfunction arg1 arg2)
    (more_code)
    (princ)
    )
    [/CODE]

    ...will render like this:

    Code:
    (defun c:fun ()
     (subfunction arg1 arg2)
     (more_code)
     (princ)
    )
    R.K. McSwain | CAD Panacea |

  7. #7
    Member
    Join Date
    2008-10
    Posts
    10
    Login to Give a bone
    0

    Default Re: Joining 2 Auto Lisp together please

    it just doesn't work, it insert the symbol but it doesn't break the line,
    thank you any way

Similar Threads

  1. AUTO LISP
    By M.Jamal Khan in forum AutoLISP
    Replies: 3
    Last Post: 2020-04-30, 08:47 PM
  2. Auto Lisp
    By MarkLyon in forum CAD Management - General
    Replies: 5
    Last Post: 2011-02-16, 03:46 PM
  3. Auto-lisp SOS!
    By praveendevdass in forum AutoLISP
    Replies: 2
    Last Post: 2010-01-14, 07:50 AM
  4. Auto-Numbering lisp
    By ldgodsey in forum AutoLISP
    Replies: 2
    Last Post: 2007-11-19, 09:51 PM
  5. NEW AUTO LISP
    By rstiles in forum AutoLISP
    Replies: 5
    Last Post: 2005-11-30, 10:27 PM

Tags for this Thread

Posting Permissions

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