<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: change Block Color in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212052#M44850</link>
    <description>&lt;P&gt;Thanks Paul&lt;/P&gt;&lt;P&gt;Still i have the same issue , and to be more Specific I have Arch Plan With Windows Hatch have True Color (255,255,255) I need To keep it the same and change all Other Object Color to be 8 Color. This lisp file Work Great For Changing the Color but the issue it take time to change all the Window&amp;nbsp; to 255,255,255 again.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 06:12:50 GMT</pubDate>
    <dc:creator>bahaatawfiq</dc:creator>
    <dc:date>2022-06-03T06:12:50Z</dc:date>
    <item>
      <title>change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11211438#M44848</link>
      <description>&lt;P&gt;Hello All i have that lisp which change the color for entire object to Specific Color But I need To Modified it ,to be Working Only For index Color, and all True Color Stay&amp;nbsp; the Same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:blcc () (pl:block-color) (princ))&lt;BR /&gt;&lt;BR /&gt;(defun c:encc () (pl:block-ent-color) (princ))&lt;BR /&gt;&lt;BR /&gt;;;;get from Alaspher &lt;A href="http://forum.dwg.ru/showthread.php?t=1036" target="_blank"&gt;http://forum.dwg.ru/showthread.php?t=1036&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;;;; &lt;A href="http://forum.dwg.ru/showpost.php?p=166220&amp;amp;postcount=18" target="_blank"&gt;http://forum.dwg.ru/showpost.php?p=166220&amp;amp;postcount=18&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;(vl-load-com)&lt;BR /&gt;&lt;BR /&gt;(defun pl:block-ent-color (/ adoc blocks color ent lays)&lt;BR /&gt;&lt;BR /&gt;(setq adoc (vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;&lt;BR /&gt;lays (vla-get-layers adoc)&lt;BR /&gt;&lt;BR /&gt;color (acad_colordlg 256)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if color&lt;BR /&gt;&lt;BR /&gt;(progn (setvar "errno" 0)&lt;BR /&gt;&lt;BR /&gt;(vla-startundomark adoc)&lt;BR /&gt;&lt;BR /&gt;(while (and (not (vl-catch-all-error-p&lt;BR /&gt;&lt;BR /&gt;(setq ent (vl-catch-all-apply&lt;BR /&gt;&lt;BR /&gt;(function nentsel)&lt;BR /&gt;&lt;BR /&gt;'("\nSelect entity &amp;lt;Exit&amp;gt;:")&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(/= 52 (getvar "errno"))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if ent&lt;BR /&gt;&lt;BR /&gt;(progn (setq ent (vlax-ename-&amp;gt;vla-object (car ent))&lt;BR /&gt;&lt;BR /&gt;lay (vla-item lays (vla-get-layer ent))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if (= (vla-get-lock lay) :vlax-true)&lt;BR /&gt;&lt;BR /&gt;(progn (setq layloc (cons lay layloc))&lt;BR /&gt;&lt;BR /&gt;(vla-put-lock lay :vlax-false)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(vl-catch-all-apply (function vla-put-color) (list ent color))&lt;BR /&gt;&lt;BR /&gt;(vla-regen adoc acallviewports)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(princ "\nNothing selection! Try again.")&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(foreach i layloc (vla-put-lock i :vlax-true))&lt;BR /&gt;&lt;BR /&gt;(vla-endundomark adoc)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(princ)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(defun pl:block-color (/ adoc blocks color ins lays)&lt;BR /&gt;&lt;BR /&gt;(setq adoc (vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;&lt;BR /&gt;blocks (vla-get-blocks adoc)&lt;BR /&gt;&lt;BR /&gt;lays (vla-get-layers adoc)&lt;BR /&gt;&lt;BR /&gt;color (acad_colordlg 256)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if color&lt;BR /&gt;&lt;BR /&gt;(progn (setvar "errno" 0)&lt;BR /&gt;&lt;BR /&gt;(vla-startundomark adoc)&lt;BR /&gt;&lt;BR /&gt;(while (and (not (vl-catch-all-error-p&lt;BR /&gt;&lt;BR /&gt;(setq ins (vl-catch-all-apply&lt;BR /&gt;&lt;BR /&gt;(function entsel)&lt;BR /&gt;&lt;BR /&gt;'("\nSelect block &amp;lt;Exit&amp;gt;:")&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(/= 52 (getvar "errno"))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if ins&lt;BR /&gt;&lt;BR /&gt;(progn (setq ins (vlax-ename-&amp;gt;vla-object (car ins)))&lt;BR /&gt;&lt;BR /&gt;(if (= (vla-get-objectname ins) "AcDbBlockReference")&lt;BR /&gt;&lt;BR /&gt;(if (vlax-property-available-p ins 'path)&lt;BR /&gt;&lt;BR /&gt;(princ "\nThis is external reference! Try pick other.")&lt;BR /&gt;&lt;BR /&gt;(progn (_pl:block-color blocks ins color lays)&lt;BR /&gt;&lt;BR /&gt;(vla-regen adoc acallviewports)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(princ "\nThis isn't block! Try pick other.")&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(princ "\nNothing selection! Try again.")&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(vla-endundomark adoc)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(princ)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(defun _pl:block-color (blocks ins color lays / lay layfrz layloc)&lt;BR /&gt;&lt;BR /&gt;(vlax-for e (vla-item blocks (vla-get-name ins))&lt;BR /&gt;&lt;BR /&gt;(setq lay (vla-item lays (vla-get-layer e)))&lt;BR /&gt;&lt;BR /&gt;(if (= (vla-get-freeze lay) :vlax-true)&lt;BR /&gt;&lt;BR /&gt;(progn (setq layfrz (cons lay layfrz)) (vla-put-freeze lay :vlax-false))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(if (= (vla-get-lock lay) :vlax-true)&lt;BR /&gt;&lt;BR /&gt;(progn (setq layloc (cons lay layloc)) (vla-put-lock lay :vlax-false))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(vl-catch-all-apply (function vla-put-color) (list e color))&lt;BR /&gt;&lt;BR /&gt;(if (and (= (vla-get-objectname e) "AcDbBlockReference")&lt;BR /&gt;&lt;BR /&gt;(not (vlax-property-available-p e 'path))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(_pl:block-color blocks e color lays)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(foreach i layfrz (vla-put-freeze i :vlax-true))&lt;BR /&gt;&lt;BR /&gt;(foreach i layloc (vla-put-lock i :vlax-true))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(progn&lt;BR /&gt;&lt;BR /&gt;(princ "\BLCC - Changes color of the chosen blocks")&lt;BR /&gt;&lt;BR /&gt;(princ "\nENCC - Changes color of the chosen objects (may be element of the block)")&lt;BR /&gt;&lt;BR /&gt;(princ))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks all for help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 20:41:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11211438#M44848</guid>
      <dc:creator>bahaatawfiq</dc:creator>
      <dc:date>2022-06-02T20:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11211877#M44849</link>
      <description>&lt;P&gt;Since Layers with a Truecolor property always has a 420 association pair, I decided to use this to test for Truecolor.&lt;/P&gt;&lt;P&gt;I added aec:&lt;SPAN&gt;chk_layer_truecolor function&lt;/SPAN&gt;&amp;nbsp;and inserted this test in the two sections of the code (attached).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; chk_layer_truecolor function
; Argument: 
; layobj = vl layer object
; Returns:
; T if Layer has Truecolor Property
; nil if Layer does not have Truecolor Property
(defun aec:chk_layer_truecolor (layobj)
   (assoc 420(entget(vlax-vla-object-&amp;gt;ename layobj)))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 03:18:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11211877#M44849</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-06-03T03:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212052#M44850</link>
      <description>&lt;P&gt;Thanks Paul&lt;/P&gt;&lt;P&gt;Still i have the same issue , and to be more Specific I have Arch Plan With Windows Hatch have True Color (255,255,255) I need To keep it the same and change all Other Object Color to be 8 Color. This lisp file Work Great For Changing the Color but the issue it take time to change all the Window&amp;nbsp; to 255,255,255 again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:12:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212052#M44850</guid>
      <dc:creator>bahaatawfiq</dc:creator>
      <dc:date>2022-06-03T06:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212059#M44851</link>
      <description>&lt;P&gt;Sounds like your Window Block actually has objects that have colors (True Color) assigned and they're not Bylayer.&lt;/P&gt;&lt;P&gt;Perhaps you can post a drawing with the Window Block inserted for everyone to take a look to confirm?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:18:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212059#M44851</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-06-03T06:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212068#M44852</link>
      <description>&lt;P&gt;yes sure, this plan Sample i need to work on it ,but changing&amp;nbsp; the 255,255,255 color to 08 will make issue with&amp;nbsp; the window the Grid number so i need to make all the drawings 08 except of these&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:24:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212068#M44852</guid>
      <dc:creator>bahaatawfiq</dc:creator>
      <dc:date>2022-06-03T06:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212087#M44853</link>
      <description>&lt;P&gt;Ok, if I understand you correctly, I've changed the code slightly so now it checks when the object itself is assigned a Truecolor the Color will not be changed.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:39:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212087#M44853</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-06-03T06:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212091#M44854</link>
      <description>You are Great Man, Thanks It Works</description>
      <pubDate>Fri, 03 Jun 2022 06:42:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212091#M44854</guid>
      <dc:creator>bahaatawfiq</dc:creator>
      <dc:date>2022-06-03T06:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: change Block Color</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212093#M44855</link>
      <description>&lt;P&gt;You are very welcome...cheers!!!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 06:44:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-color/m-p/11212093#M44855</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-06-03T06:44:21Z</dc:date>
    </item>
  </channel>
</rss>

