Leader to block LISP

Discussion in 'AutoCAD' started by Darlok69, Aug 5, 2003.

  1. Darlok69

    Darlok69 Guest

    I have a block that has a rectangle and text in the center of the rectangle that is center justified and I want to be able to connect a leader to the left and the right side of the rectangle. I can connect it to the insertion point of the block but that is in the middle of the text. Any one have any ideas. I use it for callouts and want to to be able to be either left or right side arrowed. Thanks Sean
     
    Darlok69, Aug 5, 2003
    #1
  2. Darlok69

    Walt Engle Guest

    Do the arrows have to be a variable length? If not, why not make two
    blocks, one with arrow on left side the other on the right side? And,
    how about top and bottom?
     
    Walt Engle, Aug 5, 2003
    #2
  3. Darlok69

    Darlok69 Guest

    What to have the flexibility of being able to change lengths.
     
    Darlok69, Aug 6, 2003
    #3
  4. Darlok69

    Mark Propst Guest

    assuming you know the size of your rectangle, just polar from the ins pt
    left or right by half the width
    hth
    Mark

    rectangle that is center justified
     
    Mark Propst, Aug 6, 2003
    #4
  5. Darlok69

    Mark Propst Guest

    did you intend the basepoint to be *not* at 0,0? for "PF"?
    also I don't get the attdef because I don't have the referrenced shx files.
    but if I move your rectangle to be centered on 0,0, change the base to 0,0
    rename the block to "test", eliminate the attribute then the lisp would be
    thus:
    to draw the leader from right side of block
    you'll want to adapt to what you really need but this may give yo an idea of
    how to proceed.
    (DEFUN C:pFGr (/ PT1 scale )
    (SETQ PT1 (GETPOINT "\nEnter center of spec: "))
    (setq scale (getvar "dimscale"))
    (COMMAND "-INSERT" "test" "_non" pt1 SCALE "" "")
    (SETQ PT2 (GETPOINT "\nEnter start of lead: "))
    (SETQ PT3 (polar pt1 0 (* scale 0.16620884)));this is half the width of
    your rectangle
    (SETQ PT4 (LIST (CAR PT2)(CADR PT3)))
    (COMMAND "LEADER" "_non" PT2 "_non" PT4 "_non" PT3 "" "" "N")
    )
     
    Mark Propst, Aug 6, 2003
    #5
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.