Color set to cyan but displays bylayer

Discussion in 'AutoCAD' started by sbrusco, Feb 22, 2005.

  1. sbrusco

    sbrusco Guest

    Hi,

    I wrote some code to add a leader to the drawing and instead of text, to add a block to the tail of the leader, all std acad stuff. I want the leader to be color 'cyan' and the block to be color 'bylayer'. At first, the code below 'seems' to fail because the leader displays in color 'bylayer', but when i look at the leader's properties, the color is in fact set to 'cyan'.

    Why does this entity display a different color than what is set? Am i missing something in the code?

    Can someone help me debug? Also, any other comments/suggestions about the snippet of code are welcome.

    Thanks in advance for all help and suggestions.

    (IF ldr
    (PROGN ; draw a leader
    (SETVAR "CECOLOR" "CYAN") ; set color for leader to cyan
    (IF (> (CAR ldr1) (CAR ldr2))
    ;; shift left
    (SETQ insPt (LIST (- (CAR ldr2) offL) (CADR ldr2)))
    ;; shift right
    (SETQ insPt (LIST (+ (CAR ldr2) offR) (CADR ldr2)))
    )
    (COMMAND "._LEADER" ldr1 ldr2 "" "" "BLOCK" blck "SCALE" sca insPt
    0)
    ;; change color for tag block to bylayer
    (COMMAND "CHPROP" "L" "" "COLOR" "BYLAYER" "")
    )
    (PROGN ; insert block without leader
    (COMMAND "._INSERT" blck "SCALE" sca ldr2 0)
    )
    )
     
    sbrusco, Feb 22, 2005
    #1
  2. sbrusco

    Jeff Mishler Guest

    Your dimension style's dimension line color is set to bylayer. If it is
    byblock you will get the results you desire.
     
    Jeff Mishler, Feb 22, 2005
    #2
  3. sbrusco

    sbrusco Guest

    Thanks Jeff,

    That was the problem. As you can see in my code, i was setting CECOLOR. How do i change the dim line color to 'bylayer'? If there is a sysvar, what is it?

    Thanks again for your help and speedy response.

    Sal
     
    sbrusco, Feb 23, 2005
    #3
  4. sbrusco

    sbrusco Guest

    Thanks again Jeff, I found the sysvar; DIMCLRD
     
    sbrusco, Feb 23, 2005
    #4
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.