Determine type of arrowhead for leader

Discussion in 'AutoCAD' started by Matt W, Feb 27, 2004.

  1. Matt W

    Matt W Guest

    How can I determine what type of arrowhead (I.E. CLOSED FILLED, DOT, etc...) a selected leader has??
     
    Matt W, Feb 27, 2004
    #1
  2. Matt W

    ECCAD Guest

    Matt,
    Hint:
    Properties

    Bob
     
    ECCAD, Feb 27, 2004
    #2
  3. :)
     
    Jason Piercey, Feb 27, 2004
    #3
  4. Matt W

    ECCAD Guest

    Jason,
    I think Matt has left the building ?
    ...
    :))
     
    ECCAD, Feb 27, 2004
    #4
  5. Matt W

    Matt W Guest

    Ummmm.....yeaahh.
    I'd like to obtain the arrowhead type through code (LSP).
     
    Matt W, Feb 27, 2004
    #5
  6. Matt W

    Doug Broad Guest

    Matt,
    A good place to start searching for those kind of answers is
    in the object model diagram available in the VLIDE help files under
    "ActiveX and VBA Reference".

    It took me about 15 seconds to find the answer as arrowheadtype property.

    (vla-get-arrowheadtype (vlax-ename->vla-object (car (entsel "\nPick Leader"))))

    The number that is returned can be compared to the symbols
    described under the arrowheadtype property
    acArrowDot
    acArrowDotSmall....

    Hope that helps.
     
    Doug Broad, Feb 27, 2004
    #6
  7. Matt W

    Matt W Guest

    Oh boy! VLISP!! Now we're moving into unfamiliar territory.
    Thanks for the reply. I'll see if I can muddle my way through it.

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.
     
    Matt W, Feb 27, 2004
    #7
  8. Matt W

    ECCAD Guest

    Matt,
    This one just gives you the 'name' of the leader type, not specifically the arrow / dot type..

    ;; Leader Type
    (prompt "\nSelect a Leader:")
    (setq ss (ssget))
    (setq ent (ssname ss 0))
    (setq e_list (entget ent))
    (setq l_name (cdr (assoc 3 e_list)))
    (princ)
    (princ l_name)

    Bob
     
    ECCAD, Feb 27, 2004
    #8
  9. Matt W

    Doug Broad Guest

    Its a bit harder with legacy lisp. You need to look up the dimension
    DXF codes and leader DXF codes in the VLIDE help under DXF Reference.

    Any overrides are stored as xdata with the object, having the application
    code "ACAD". If there is no override, then you need to get the information
    from the dimension style. But that gets complicated because the dimension
    styles can have children. Looking up the correct children takes a little research.

    The only reason I would use legacy methods for this kind of application
    is if I needed to support R14 customers.

    Start with (entget (car (entsel)) '("*"))

    If there are any overrides, then some xdata will be returned. Use
    the properties command to change the arrowhead type and then
    investigate the changes the above statement returns. Looks like
    it returns a dxf code 341 in the xdata and the next element is the
    handle of the block that references the arrowhead. Too complicated
    for me.
     
    Doug Broad, Feb 27, 2004
    #9
  10. Matt W

    Doug Broad Guest

    Actually Bob, that would return the name of the dimstyle that
    is used by the leader but it would not necessarily lead him to
    how to get the arrowhead name. For this application, using
    vlisp immensly simplifies the task. Otherwise:

    ;;get block name from handle
    ;;D. C. Broad, Jr. - Demonstration 2/27/2004
    (defun getname (hnd)
    (cond
    ((null hnd) nil)
    ((null (handent hnd)) nil)
    ((cdr(assoc 2 (entget (handent hnd)))))))

    ;;Code to get arrow block name of leader with legacy methods
    (cond
    ((null (setq e (car (entsel))))
    (princ "\nNo object selected"))
    ((/= "LEADER" (cdr (assoc 0 (setq ei (entget e '("ACAD"))))))
    (princ "\nNot a leader"))
    ((null (setq xdata (cdadr (assoc -3 ei))
    arrowhandle (cdadr(member '(1070 . 341) xdata))))
    (setq dimstyle (entget (tblobjname "dimstyle" (cdr(assoc 3 ei)))))
    (princ (strcat "Arrowhead is "
    (cond
    ((getname (cdr (assoc 341 dimstyle))))
    ((getname (cdr (assoc 342 dimstyle))))
    ("Default")))))
    (t
    (princ (strcat "Arrowhead is " (cond
    ((getname arrowhandle))
    ("Default"))))))

    That's a ridiculous amount of code, but AFAIK the minimum to get
    it reliably. Yuck!
     
    Doug Broad, Feb 27, 2004
    #10
  11. Matt W

    ECCAD Guest

    Doug,
    Thanks for the insight. Pretty murky down there..
    I like the:
    (vla-get-arrowheadtype (vlax-ename->vla-object (car (entsel "\nPick Leader"))))
    approach..much better.

    Bob
     
    ECCAD, Feb 27, 2004
    #11
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.