Leader and text on diff. layers?

Discussion in 'AutoCAD' started by Kiwi Russ, Apr 28, 2004.

  1. Kiwi Russ

    Kiwi Russ Guest

    Hello
    I am trying to make a simple lisp that places the leader and
    caption on different layers.
    So the leader and arrow will be set to the layer called "Dimension" and the
    text will be set to the layer called "2.5 Text"

    In our office the text is yellow and our leaders and arrows are red, this
    means I can not place it all bylayer. The only way around this is to make
    the arrow and leader one layer and the text another layer. However I can not
    see if it is possible to do this using "qleader" or "leader". Perhaps it is
    not possible? Any ideas?

    Thank you.....
    Russ
     
    Kiwi Russ, Apr 28, 2004
    #1
  2. Kiwi Russ

    Warren Trost Guest

    What happens if you turn off the text layer and the leader is all by itself,
    or turn off the dimension layer and the text is all by itself? If a
    dimstyle for leader is set to byblock, the leader can have a different color
    and still be associated with the text. Or why not place the leader on a
    different layer other than the dimensions.
     
    Warren Trost, Apr 28, 2004
    #2
  3. Kiwi Russ

    David Kozina Guest

    Perhaps...
    Define the DIMSTYLE dimension/extension linework color as BYBLOCK.
    Define the DIMSTYLE text color as BYLAYER
    Define the dimension LAYER color as YELLOW
    Fix the linework before the fact via CECOLOR set to RED

    No need for two layers for this, IMO.

    Avoid hardcoding 'non-logical' colors (ie NOT BYBLOCK,BYLAYER, etc) in your
    base definitions (blocks, dimstyles, etc). This will give you much more
    flexibility later if/when someone should decide to change your company
    standard.
     
    David Kozina, Apr 28, 2004
    #3
  4. It doesn't make any sense to me to have a leader that is not related to
    dimensions on a Dimension layer. But if you really want them on different
    layers (preferably named <something-with-leader> and <something-with-text>),
    you CAN change the layer of each of them independently. It shouldn't be too
    hard to make a Leader or Qleader routine that would immediately change the
    layer of the Last item (the text).

    But I don't like doing the caption at the end of the leader or qleader
    command, for several reasons. Even when you are asking for Mtext for the
    annotation, it doesn't work like regular Mtext in several ways. Depending
    on how you get to it, whether you're in Leader or Qleader, and what settings
    you have, it can give you a "zero"-width (non-wrapping) piece of Mtext (and
    if you use Enters to make multiple lines, it's a problem later if you want
    to edit the content), or you can be prompted for a width but then not be
    able to see the text wrapping as you go, or other quirks.

    And besides, for whatever reason, the leader and text are only associated
    with each other in one direction. If you move the text with its insertion
    point grip, that end of the leader goes with it, but if you do the same with
    the leader, the text does NOT follow it.

    And you can't do the Mtext with any blank lines within it, as you can with
    regular Mtext.

    (And on another topic, why on earth does a DIM leader ends up as separate
    arrow head and lines, rather than a functioning leader?)

    I prefer to put the text in as Mtext first, then put the leader, and skip
    the text part of the leader/qleader command. It's not hard to "associate"
    them by just using Stretch if you want to reposition something. And you can
    put a whole batch of notes for something like a wall section in one Mtext
    entity, all nicely lined up, instead of a separate one for each leader. So
    I have leader menu items that bypass the annotation parts at the end,
    automatically.

    For your question, that approach makes it really easy, if you want, to put
    them on different layers, because you can build the layer setting into the
    menu item or button or icon or whatever, for each of them.

    Kent Cooper, AIA

    ...
     
    Kent Cooper, AIA, Apr 28, 2004
    #4
  5. Kiwi Russ

    Warren Trost Guest

    I have to agree that the leader should be with the text or symbol or
    whatever it is associated with. I handle this by using a routine to place
    the leader then go into placing text as one step.
     
    Warren Trost, Apr 28, 2004
    #5
  6. Kiwi Russ

    Kiwi Russ Guest

    Thanks for your interesting opinions ans answers.
    Well I think I shall take Kent's idea and make my own lisp for the leader
    and add on "mtext".
    I want to use a layer called "leader" for the leader and I'll use "text" for
    the mtext.
    here's what I have so far....
    there are 2 problems
    1) why does the arrow and line not stay as one entity?
    2) if I want to find the point where I start my text how can I do this?

    (defun C:LE ()
    (setvar "CMDECHO" 1)
    (command "layer" "make" "Leader" "ltype" "continuous" "" "color" "red" ""
    "")
    (command ".color" "bylayer" "" )
    (command "linetype" "set" "bylayer" "")
    (command "layer" "set" "Leader" "")
    (command "dim1" ".LEADER" pause pause "" "")
    (princ)
    );defun

    thanks Russ
     
    Kiwi Russ, Apr 29, 2004
    #6
  7. Kiwi Russ

    Joe Burke Guest

    Hi Russ,

    May I suggest the simple minded approach:

    Command: (command "leader" pause pause "") ;enter text

    Then use entlast to change the text to your text layer. I think you want to avoid
    creating the text separately. Justification would be an issue. Which way was the
    leader drawn...

    The reason your example doesn't create a leader is "dim1". See help.

    Joe Burke
     
    Joe Burke, Apr 29, 2004
    #7
  8. 1: Leaders made with the leader sub-prompt in DIMensioning, for some stupid
    reason (or maybe for no reason, or maybe as a holdover from before there was
    such a thing as a functioning Leader), are like that. Use the "real" Leader
    command instead, as Joe Burke suggests.
    2: I don't bother. I "eyeball" it to end where I want, and set snap to
    some value healthily smaller than the text height, so I can have the last
    two points of the leader aimed cleanly horizontal toward the text. If you
    want to USE the Leader annotation function, and want several to line up
    nicely, I'd suggest setting a snap value. (But as I described earlier, I
    don't like to, for several reasons.)

    Here's what I use, giving users some options. They're just macros from a
    pop-menu, but I have them on a Tablet, too. (I wish the newsreader wouldn't
    interpret double backslashes this way, but I haven't found a way around it.)
    We have a standard Notes layer in all drawing templates, so the routine
    doesn't make one as yours does (and doesn't the Make option in Layer also
    set the Layer you made as the current one, so you don't have to set that
    later?). They all set it to that layer, and repeat automatically (by
    different means), so I can (for example) put a whole bunch of leaders in a
    wall section onto a whole bunch of notes that are in one Mtext entity for
    clean alignment, with just one menu pick. The first two leave you the
    annotation part (to use it, or to get out of it on your own), while the
    others skip past that for you. ["USERI1" is where we store the drawing
    ratio that a lot of people use DIMSCALE for, e.g. 48 for 1/4"=1'-0"]

    [Leader]^C^C-LAYER S NOTES MULTIPLE LEADER
    (just for your basic Leader command, to be carried out however you want)
    [Spl Leader]*^C^C-LAYER S NOTES LEADER \\F S
    (same, but goes for the Spline leader option after you've given it the
    first two points)
    [4pt Spln Ldr]*^C^C-LAYER S NOTES LEADER \\F S \\;;N;
    (same, but cuts it off after four points: one for the arrowhead, one to
    establish the general direction from there, and two to "aim" the other end
    to the text; then bypasses the annotation parts)
    [2 Line Ldr]*^C^C^P-LAYER S NOTES (setq ortho (getvar "ORTHOMODE")) +
    (setq snap (getvar "SNAPUNIT")) ORTHO OFF SNAP OFF LEADER \'SNAP +
    (* (getvar "USERI1") 0.03125) \\;;N;ORTHOMODE !ortho ^PSNAPUNIT !snap
    (a "simpler" version of the above, for a two-segment straight-line
    Leader, but it also sets the snap value to an increment appropriate to land
    the end segment at a level within the height of a line of text, turns snap
    off for fine placing of the arrowhead, turns Ortho on to force the second
    leg horizontal, then sets snap and ortho back to what they were before -- I
    really should put those features in the other ones, but I think I had a
    reason not to, that I can't remember now....)

    Kent Cooper, AIAKent Cooper, AIA Schwam Architects 215-635-7000, x115 Fax
    215-635-0930/3345
     
    Kent Cooper, AIA, Apr 29, 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.