Results 1 to 3 of 3

Thread: Lisp to change layer color in viewport

  1. #1
    Member
    Join Date
    2008-05
    Posts
    20
    Login to Give a bone
    0

    Default Lisp to change layer color in viewport

    Hi
    i was wondering if there could be lisp or macro to change all layers colors of xref in viewport to only one color using property override

    any help is grealty apprciated

  2. #2
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Lisp to change layer color in viewport

    This is totally stumping me ... according to help this should be available through any one of the following DXF codes of a VIEWPORT entity: 91, 335, 343 or 344. After setting a layer with a colour override inside a viewport, that VIEWPORT entity still doesn't have any of these DXF codes.

    So I checked the ActiveX - there's no mention of Layer Property Overrides in the Help at all. So I used the VLIDE inspector on a (vlax-ename->vla-object ...) this provided only a Has Layer Overrides property of VLAX:TRUE. So it's there somewhere .... but how do you get / set it? Must be a method & not a property - so inspection won't show it.

    Next I got hold of the LAYER in question ... (entget (tblobjname "LAYER" "...")). Finally there's a 360 code in the "{ACAD_XDICTIONARY" group, pointing to a "ADSK_XREC_LAYER_COLOR_OVR" dictionary object. The XRECORD object under this (DXF code 360 again) has a pointer to the LAYER (code 335) followed by a 420 code with (what looks like) the colour's RGB value as an integer. There's no pointer whatsoever to the VIEWPORT which actually shows this override. What can one do?

  3. #3
    Member
    Join Date
    2008-05
    Posts
    20
    Login to Give a bone
    0

    Default Re: Lisp to change layer color in viewport

    thanks alot for ur answer and sorry for being late replying , i dont know much abt lisp but im good in macros , i thought i could make macro to set my viewport active then import and restore layerstate that changes all layers colors to the required one , unfortunately it didnt work , i used ( -la "a" "r" ) but it has no effect on vp colors , i checked the help and found function called "layerstate-restore" but couldnt figure it out how it use it in lisp
    hope u or anybody can help me in this

Similar Threads

  1. Replies: 4
    Last Post: 2015-02-16, 07:53 PM
  2. Replies: 8
    Last Post: 2015-01-06, 01:15 PM
  3. LISP for change yellow color into Color 8
    By rhodinj1427782 in forum AutoLISP
    Replies: 6
    Last Post: 2014-01-16, 05:26 AM
  4. Layer Color Change LISP Routine
    By guardianfiredesign774457 in forum AutoLISP
    Replies: 19
    Last Post: 2013-08-28, 05:08 AM
  5. Replies: 6
    Last Post: 2007-05-30, 05:45 PM

Posting Permissions

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