I Found some lisp programs

Discussion in 'AutoCAD' started by Bigjobs, Jun 21, 2004.

  1. Bigjobs

    Bigjobs Guest

    Right then, after searching high & low I have managed to find some lisp
    programs that I have been searchimg for high & low.

    There are a few of them, but of particular note are Average.lsp &
    incrmnt.lsp,

    Average is a osnap, it gives a point in 3d from a number of clicked points,
    ideal for clicking on the 2d centre of a rectangle, or a 3d centre of a
    cube, or even a line two thirds of the way along. The only small problem
    with Acad 2k4 is that it requires an enter press rather than a right click
    to exit, as a right click exits the parent command (i.e. line) as well. I
    think this is to do with the way my right click is set up, but I am not
    sure.

    Incrmnt inserts a number from a given value to a given value in a given step
    value, at a given height to points clicked on. Handy for room numbers I use
    it for cabinet numbers).

    I never wrote these and claim nothing in the way of authorship, or
    development at all. I was sent them from Caddesk a few years back for R14.
    The author is a Mr. Andrew Bichard, and a mighty fine job he did of them
    too.

    I searched Cadalot and a few others for these type of files, but the only
    text insertion lisp I could find was for numbering existing text. This one
    creates it at the point clicked on.

    Let me know if anyone wants a copy, they come in a zip file (225k) and
    whilst I haven't read the licence agrement thing recently, I will only send
    it whole, as I remember it saying somewhere that I could distirbute it as
    much as I wanted as long as nothing was altered and it had all the stuff
    together?).

    Bigjobs
     
    Bigjobs, Jun 21, 2004
    #1
  2. Bigjobs

    B. W. Salt. Guest

    I would like to take a look at those. Thanks for the offer.

    Brian Salt.
    Remove NS from address before replying.
     
    B. W. Salt., Jun 21, 2004
    #2
  3. Bigjobs

    Bigjobs Guest

    Sent them from work, you should have them by now.

    Bigjobs
     
    Bigjobs, Jun 21, 2004
    #3
  4. Bigjobs

    Dennis Guest


    Yes, the increment program would be usefull, please send. TIA

    Dennis


    --
     
    Dennis, Jun 22, 2004
    #4
  5. Bigjobs

    B. W. Salt. Guest

    Yes, indeed. Thank you.
     
    B. W. Salt., Jun 22, 2004
    #5
  6. Bigjobs

    woodrose Guest

    I have this lisp for numbering cabinets
    any good?

    ;| BALLOON
    Input: size of balloon, arrow location,
    balloon location, size of balloon, number
    Output: draws assembly balloon
    Variables:
    blndia Balloon diameter, GLOBAL
    blnnum Balloon number, GLOBAL
    cen Centre of balloon
    ep Endpoint of arrow
    oom Old osnap mode
    sp Start point of arrow
    temp Temp. value for blndia and blnnum input
    ts Name of current text style
    tshei Text style height |;

    ;10====PROGRAM SETUP

    (defun c:balloon (/ cen ep oom sp temp ts tshei)
    (setq oom (getvar "osmode"))
    (graphscr)

    ;20====GET SIZE, START POINT, CENTRE, & NUMBER

    (if (null blndia)
    (if (= 0 (getvar "dimscale"))
    (setq blndia (/ (getvar "dimtxt") 0.28))
    (setq blndia (/ (* (getvar "dimtxt") (getvar "dimscale")) 0.28))
    )
    )
    (initget 6)
    (setq temp (getreal (strcat "\nBalloon diameter <" (rtos blndia 2 3) ">:
    ")))
    (if temp (setq blndia temp))

    (setvar "osmode" 512)
    (initget 1)
    (setq sp (getpoint "\nStartpoint of arrow: "))
    (setvar "osmode" 0)

    (initget 1)
    (setq cen (getpoint sp "\nLocation of balloon: "))

    (if (null blnnum) (setq blnnum 0))
    (setq blnnum (1+ blnnum))
    (initget 6)
    (setq temp (getint (strcat "\nBalloon number <" (itoa blnnum) ">: ")))
    (if temp (setq blnnum temp))

    ;30====CALCULATE ENDPOINT OF ARROW, GET TEXT STYLE HEIGHT, DRAW BALLOON

    (setq ep (polar cen (angle cen sp) (/ blndia 2)))

    (setq ts (getvar "textstyle"))
    (setq tshei (cdr (assoc 40 (tblsearch "style" ts))))
    (if (> tshei 0) (princ "\nText style has fixed height; may not fit
    balloon."))

    (setvar "cmdecho" 0)
    (command ".dim1" "leader" sp ep) (command)
    (command ".circle" cen "D" blndia)

    (if (> tshei 0)
    (command ".text" "M" cen 0 blnnum)
    (command ".text" "M" cen (* 0.28 blndia) 0 blnnum)
    )

    ;40====RESET

    (setvar "cmdecho" 1)
    (setvar "osmode" oom)
    (princ)
    )

    Dave L
     
    woodrose, Jun 23, 2004
    #6
  7. Bigjobs

    Bigjobs Guest

    Very good that, I may be using that in the near future, thanks.

    Bigjobs
     
    Bigjobs, Jun 24, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.