Consulting

Results 1 to 5 of 5

Thread: Solved: AutoCAD 2004 - Color Control

  1. #1
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location

    Solved: AutoCAD 2004 - Color Control

    Hey Guys,

    With the following code I can change the current layer's color:

    [VBA]Sub TestChangeLayerColor()
    ThisDrawing.ActiveLayer.color = acBlue
    End Sub[/VBA]
    Very simple.

    But let's say I don't want to change EVERY entity that is on that layer to the color blue....how do I change the color in the "Color Control" drop-down box to a different color? I can't find it anywhere??!!




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  2. #2
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    No suggestions?

    I found some stuff on the AcadAcCmColor...and it seems to change the object's colors....but how can I get it to change the color control?

    I also looked into toolbars and possibly modifying the toolbars via code...but no luck, mostly read-only stuff


    Grrrrr This is aggrevating. I'll keep searching.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location

    FINALLY

    [VBA]ThisDrawing.SendCommand "-color" & vbCr & "ByLayer" & vbCr[/VBA]

    marking it solved.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I never had a chance to look at this joseph. Glad you got it handled.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    It's all good. It was just so annoying because there was nothing in the Developer help on it (or in my AutoCAD vba book).




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •