Leader without LEADER

Discussion in 'AutoCAD' started by Fatty, Aug 4, 2004.

  1. Fatty

    Fatty Guest

    I have two routines which draw leaders with arrow head
    and circle head. How I can modify it with VLA-command
    without LEADER command.
    Thanks,
    Fatty.

    (defun twoarrowlead ()
    (setvar "OSMODE" 512)
    (setq p1 (getpoint)
    p2 (getpoint p1)
    p3 (getpoint p2)
    ang1 (angle p1 p3)
    ang2 (angle p2 p3)
    ang3 (getangle p3)
    a (polar p1 ang1 120.0)
    b (polar p2 ang2 120.0)
    ep (polar p3 ang3 1000.0))
    ;;; more than two leaders:
    ;;; (setq pN (getpoint p(N-1) etc. etc...)
    (setvar "OSMODE" 0)
    ;;; (command "_.osnap" "_none" "")
    (command "_.pline" p1 "W" 0.0 40.0 a
    "W" 0.0 0.0 p3 "")
    (command "_.pline" p2 "W" 0.0 40.0 b
    "W" 0.0 0.0 p3 ep "")
    (command "")
    (setvar "OSMODE" 512)
    (princ)
    )
    (princ)
    (twoarrowlead)


    (defun twocirclelead ()
    (setvar "OSMODE" 512)
    (setq p1 (getpoint) p2 (getpoint p1)
    p3 (getpoint p2) ang1 (angle p1 p3)
    ang2 (angle p2 p3) ang3 (getangle p3)
    rad 75. a (polar p1 ang1 rad)
    b (polar p2 ang2 rad) cp (polar p3 ang3 500.0)
    x (car cp) y (cadr cp) ep (polar p3 ang3 1000.0))
    (setvar "OSMODE" 0)
    (command ".circle" p1 rad "")
    (command ".circle" p2 rad "")
    (command "_.line" a p3 "")
    (command "_.pline" b p3 ep "")
    (command "")

    ;;; extension:
    (entmake
    (list '(0 . "MTEXT")
    '(100 . "AcDbEntity")
    '(8 . "0")
    '(100 . "AcDbMText")
    (cons 10 (list x y 0.0))
    '(1 . "Some\\Ptext")
    '(71 . 5)))
    (setvar "OSMODE" 512)
    (princ)
    )
    (princ)
    (twocirclelead)
     
    Fatty, Aug 4, 2004
    #1
  2. Fatty

    Jürg Menzi Guest

    Hi Fatty
    You've to be a little bit more precise.
    Do you ask for creating the same objects as you sample does -
    but by VisualLISP (vla-)?
    or...
    Do you like to modify existing leader objects by VisualLISP?

    Cheers
     
    Jürg Menzi, Aug 5, 2004
    #2
  3. Fatty

    Fatty Guest

    Hi, Juerg!
    (Umlaut is not working)
    Good question...
    It's need to me for practice because I'm start to learning Autolisp
    only seven mouth ago (as well as english). Now I try to learning it
    careful. Right now I'm working on problem by extraction data
    out of blocks (like VxGetAtts)

    Good luck,
    Fatty
     
    Fatty, Aug 6, 2004
    #3
  4. Fatty

    Juerg Menzi Guest

    Oops... fast finger...

    Forgot to say that all parameters are depending from the dimension style settings.

    Cheers
     
    Juerg Menzi, Aug 6, 2004
    #4
  5. Fatty

    Fatty Guest

    Thanks, Juerg!
    My favorite cookie: take one big ripe duchess pear, divide it in half, than take one slice
    not very hard and not very salty swess cheer a half-inch, make a sandwich
    just without bread. Let's enjoy! (It's favorite Michelangelo's breakfast).
     
    Fatty, Aug 6, 2004
    #5
  6. Fatty

    Jürg Menzi Guest

    Hi Fatty

    Welcome...:cool:
    Sounds delicious...

    Cheers
     
    Jürg Menzi, Aug 6, 2004
    #6
  7. Fatty

    GaryDF Guest

    Great routine............

    Gary


     
    GaryDF, Aug 6, 2004
    #7
  8. Fatty

    GaryDF Guest

    added some modifications........

    (defun c:MultiAlead ( / AcaDoc ArrSiz CurSpc EndPnt FstPnt NxtAng NxtPnt ObjLst
    OldOsm PicPnt PntLst TmpLst TmpObj TmpPnt *error*)
    (ARCH:F_S-VAR) ;;added my save vars
    (setvar "orthomode" 1) ;added ortho on
    (ARCH:CUSTOM_LAYERS-ANNO-LDR) ;;added my layer
    (ARCH:SET-NOTES) ;;added my text style

    remainder of your code here

    (ARCH:F_R-VAR) ;;added my restore vars
    (princ)
    )


    Gary
     
    GaryDF, Aug 6, 2004
    #8
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.