<?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: Color 3DFace entities according to their Z-value. (modify existing lisp code) in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833218#M33075</link>
    <description>&lt;P&gt;i have mistaken with &lt;STRONG&gt;min max range&lt;/STRONG&gt;( but i have updated the code and corrected that issue, also i have updated the way gradation looks. it is way smoother now)&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2023 08:06:07 GMT</pubDate>
    <dc:creator>komondormrex</dc:creator>
    <dc:date>2023-03-20T08:06:07Z</dc:date>
    <item>
      <title>Color 3DFace (and Polyline, Text, or Point) entities according to their Z-value. (Modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11823340#M33066</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is a fabulous Code I found somewhere which is by &lt;STRONG&gt;LeeMac&lt;/STRONG&gt; probably. This code applies color to 3DFace entities according to their Z-value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:zmap ( / cma cmi del elv enx idx lst pct rng sel zmn zmx )
    (setq cmi '(0        0     255) ;; Minimum colour
          cma '(255      0       0) ;; Maximum colour
          zmx -2.0
          zmn -14.0
    )
    (if (setq sel (ssget "_:L" '((0 . "3DFACE"))))
        (progn
            (repeat (setq idx (sslength sel))
                (setq enx (entget (ssname sel (setq idx (1- idx))))
                      elv (if (= "3DFACE" (cdr (assoc 0 enx)))
                              (max (cadddr (assoc 10 enx)) (cadddr (assoc 11 enx)))
                              (cdr (assoc 38 enx))
                          )
                      lst (cons (list enx elv) lst)
                      zmx (max zmx elv)
                      zmn (min zmn elv)
                )
            )
            (setq rng (mapcar '- cma cmi)
                  del (- zmx zmn)
            )
            (if (equal 0.0 del 1e-8)
                (princ "\nNo change in elevation.")
                (foreach itm lst
                    (setq pct (/ (- (cadr itm) zmn) del))
                    (entmod
                        (append (car itm)
                            (list
                                (cons 420
                                    (apply 'LM:rgb-&amp;gt;true
                                        (mapcar '(lambda ( a b ) (+ a (* b pct))) cmi rng)
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )
    (princ)
)
 
;; RGB -&amp;gt; True  -  Lee Mac
;; Args: r,g,b - [int] Red, Green, Blue values
 
(defun LM:RGB-&amp;gt;True ( r g b )
    (logior (lsh (fix r) 16) (lsh (fix g)  (fix b))
)
 
(princ)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem with this code is that I can only select two colors and it will create a gradient based on them. Instead, I need to be able to select more than two colors, such that the gradient starts from the first (minimum) color and proceeds to next colors, and finally ending on the last (maximum) color.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For starters, you can try to include (some or all of) the following colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;    (setq cmi '(0        0     255) ;; Minimum colour
		col_2 '(0       95     255)
		col_3 '(0      205     255)
		col_4 '(0      255     160)
		col_5 '(30     255       0)
		col_6 '(215    255       0)
		col_7 '(255    225       0)
		col_8 '(255    185       0)
		col_9 '(255    100       0)
          cma '(255      0       0) ;; Maximum colour
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 08:05:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11823340#M33066</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-21T08:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825573#M33067</link>
      <description>&lt;P&gt;hey, not a modification, but paints with what you want&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;*****************************************************************************************************************************************************************

;	komondormrex, mar 2023

;*****************************************************************************************************************************************************************

(defun get_mid_color (color_value color_gradation_list / color_number)
	(setq color_number (atoi (rtos color_value)))
	(if (&amp;lt; color_number (1- (length color_gradation_list)))
		(mapcar '(lambda (color_1 color_2) (- color_1  (atoi (rtos (* (- color_value (fix color_value)) (- color_1 color_2)) 2 0))))
				 (nth color_number color_gradation_list)
				 (nth (1+ color_number) color_gradation_list)
		)
		(nth color_number color_gradation_list)
	)
)

;*****************************************************************************************************************************************************************

(defun c:a-la_z_gradient (/ color_gradation_list 3dface_ename_list min_z_total average_z z_scale nth_z_scale color_object rgb_color_list)
	(setq color_gradation_list '(  ; r   g   b
									(0   0   255)
									(0   95  255)
									(0   205 255)
									(0   255 160)
									(30  255 0)
									(215 255 0)
									(255 225 0)
									(255 185 0)
									(255 100 0)
        							(255 0   0)
						   		)
;		  min_max_height_list '(-10 -4)
		  min_max_height_list nil
		  3dface_ename_list (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "3dface"))))))
		  min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget (car 3dface_ename_list))))) 4.0)
		  max_z_total min_z_total
	)
	(foreach ename 3dface_ename_list
		(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget ename)))) 4.0))
		(cond
			(
				min_max_height_list
					(cond
						(
							(and
								(&amp;gt;= average_z (car min_max_height_list))
								(&amp;lt;= average_z (cadr min_max_height_list))
							)
								(vlax-ldata-put ename "Average_Z" average_z)
						)
						(
							t
						)
					)
			)
			(
				t
					(vlax-ldata-put ename "Average_Z" average_z)
					(if (&amp;lt; average_z min_z_total) (setq min_z_total average_z))
					(if (&amp;gt; average_z max_z_total) (setq max_z_total average_z))
			)
		)
	)
	(if min_max_height_list
		(setq min_z_total (car min_max_height_list)
			  max_z_total (cadr min_max_height_list)
		)
	)
	(setq z_scale (* 1e3 (- max_z_total min_z_total)))
	(cond
		(
			(not (zerop z_scale))
				(setq nth_z_scale (/ z_scale (1- (length color_gradation_list)))
					  color_object (vlax-create-object (strcat "AutoCAD.AcCmColor." (substr (getvar 'acadver) 1 2)))
				)
				(foreach ename 3dface_ename_list
					(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
						(progn
							(setq rgb_color_list (get_mid_color (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale) 
																color_gradation_list
												 )
							)
							(vla-setrgb color_object (car rgb_color_list)
													 (cadr rgb_color_list)
													 (caddr rgb_color_list)
							)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
						(progn
							(vla-setrgb color_object 255 255 255)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
					)
				)
		)
		(
			t
				(princ "\nZ coodinates are equal")
		)
	)
	(foreach ename 3dface_ename_list
		(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z")
		)
	)
	(princ)
)

;*****************************************************************************************************************************************************************&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 08:24:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825573#M33067</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T08:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825703#M33068</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;Thank you so much for your effort. This works great, but I still have two questions.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What if I need to increase or decrease the number of colors? Can I just add or remove RGB codes from the list?&lt;/LI&gt;&lt;LI&gt;What if I need to limit the colors inside certain elevation range? For example, (using the cad file I provided) what if I say apply the "minimum" color to all the entities with Z-value less than -10m and apply the "maximum" color to all the entities with Z-value greater than -4m.&amp;nbsp; (Screenshot Attached).&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 16 Mar 2023 11:58:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825703#M33068</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-16T11:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825928#M33069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;OL&gt;&lt;LI&gt;What if I need to increase or decrease the number of colors? Can I just add or remove RGB codes from the list?&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;yes, you can do this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;What if I need to limit the colors inside certain elevation range? For example, (using the cad file I provided) what if I say apply the "minimum" color to all the entities with Z-value less than -10m and apply the "maximum" color to all the entities with Z-value greater than -4m.&amp;nbsp; (Screenshot Attached).&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that might be think over&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:16:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825928#M33069</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-16T13:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825946#M33070</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;Ok I figured out the answer to my first question. Using the following line I can control the number of colors.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(setq tenth_z_scale (/ z_scale 9.0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Now I have to figure out a way to automatically count the number of colors in the list and then update this line accordingly.&lt;/P&gt;&lt;P&gt;Anyway, that leaves only question No. 2 for you.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:27:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825946#M33070</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-16T13:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825975#M33071</link>
      <description>&lt;P&gt;better be done with &lt;STRONG&gt;length&lt;/STRONG&gt; function. see updated code above.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:40:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11825975#M33071</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-16T13:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11826009#M33072</link>
      <description>&lt;P&gt;Yes. I figured it out but my method is lengthy. I did this;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;num_colors (length color_gradation_list)
...
(setq tenth_z_scale (/ z_scale (- num_colors 1))&lt;/LI-CODE&gt;&lt;P&gt;I am quiet new to this world. Your code is graceful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhow, please help me with the 2nd question if possible.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:55:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11826009#M33072</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-16T13:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11826170#M33073</link>
      <description>&lt;P&gt;well, i have updated the code to comply with point 2. pay attention to lines&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;min_max_height_list '(-10 -4) - &lt;/STRONG&gt;sets min and max heights to color&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;; min_max_height_list nil&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- unsets min and max heights to color&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 14:47:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11826170#M33073</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-16T14:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11829752#M33074</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;Thank you very much for your great amount of thought and effort. I do appreciate every single moment of your time that you spent on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This final update *almost* complies with point 2, as it colors the entities falling &lt;STRONG&gt;within&lt;/STRONG&gt; the predefined elevation range as white (255,255,255), instead of the colors defined in the color-gradation-list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, as per my working requirements, the final update almost solves my problem. Therefore, I am happily marking this update as the SOLUTION.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like I cannot thank you enough.&lt;/P&gt;&lt;P&gt;Stay blessed and live long.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~Yasir&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 19:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11829752#M33074</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-17T19:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833218#M33075</link>
      <description>&lt;P&gt;i have mistaken with &lt;STRONG&gt;min max range&lt;/STRONG&gt;( but i have updated the code and corrected that issue, also i have updated the way gradation looks. it is way smoother now)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 08:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833218#M33075</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T08:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833641#M33076</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;for taking a &lt;STRONG&gt;good working solution&lt;/STRONG&gt; to the next level and making it &lt;STRONG&gt;almost perfect&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the slight imperfection (color gradient not being smooth) is actually quite useful technically. For instance, if one has to visually inspect or modify entities falling under a certain elevation range, the non-smooth pre-defined colors makes it really easy to select such entities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, please post the previous version of your code also. I want to accept it as a &lt;STRONG&gt;second solution&lt;/STRONG&gt; too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I don't want to sound too demanding, but I have another question. What if I want to apply the same color grading to entities other than 3DFaces? (e.g. Polylines, Points, or Text objects). Is it better to modify this code you already provided or should I try to rewrite separate code for every type of entity? Which option can prove more efficient?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. The Text objects I mention will be actually placed on the Z-elevation in drawing, regardless of the contents of the text object. It means I don't need to analyze the actual content of the text objects to classify them for various levels.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 11:48:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833641#M33076</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-20T11:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833798#M33077</link>
      <description>&lt;P&gt;hello again!&lt;/P&gt;&lt;P&gt;as per previous version i can't post it, cause there is no more of it. but i have changed the code so you can select either to smooth or not coloring of the objects. see it right below. there is commented out &lt;STRONG&gt;smooth_gradation&lt;/STRONG&gt; variable set to true. if you uncomment it, gradation will be smooth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;*****************************************************************************************************************************************************************

;	komondormrex, mar 2023

;*****************************************************************************************************************************************************************

(defun get_mid_color (color_value color_gradation_list / color_number)
	(setq color_number (atoi (rtos color_value)))
	(if (&amp;lt; color_number (1- (length color_gradation_list)))
		(mapcar '(lambda (color_1 color_2) (- color_1  (atoi (rtos (* (- color_value (fix color_value)) (- color_1 color_2)) 2 0))))
				 (nth color_number color_gradation_list)
				 (nth (1+ color_number) color_gradation_list)
		)
		(nth color_number color_gradation_list)
	)
)

;*****************************************************************************************************************************************************************

(defun c:a-la_z_gradient (/ color_gradation_list 3dface_ename_list min_z_total average_z z_scale nth_z_scale color_object rgb_color_list smooth_gradation
							min_max_height_list
						 )
	(setq color_gradation_list '(  ; r   g   b
									(0   0   255)
									(0   95  255)
									(0   205 255)
									(0   255 160)
									(30  255 0)
									(215 255 0)
									(255 225 0)
									(255 185 0)
									(255 100 0)
        							(255 0   0)
						   		)
;		  min_max_height_list '(-10 -4)
;		  smooth_gradation t
		  3dface_ename_list (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "3dface"))))))
		  min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget (car 3dface_ename_list))))) 4.0)
		  max_z_total min_z_total
	)
	(foreach ename 3dface_ename_list
		(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget ename)))) 4.0))
		(cond
			(
				min_max_height_list
					(cond
						(
							(and
								(&amp;gt;= average_z (car min_max_height_list))
								(&amp;lt;= average_z (cadr min_max_height_list))
							)
								(vlax-ldata-put ename "Average_Z" average_z)
						)
						(
							t
						)
					)
			)
			(
				t
					(vlax-ldata-put ename "Average_Z" average_z)
					(if (&amp;lt; average_z min_z_total) (setq min_z_total average_z))
					(if (&amp;gt; average_z max_z_total) (setq max_z_total average_z))
			)
		)
	)
	(if min_max_height_list
		(setq min_z_total (car min_max_height_list)
			  max_z_total (cadr min_max_height_list)
		)
	)
	(setq z_scale (* 1e3 (- max_z_total min_z_total)))
	(cond
		(
			(not (zerop z_scale))
				(setq nth_z_scale (/ z_scale (1- (length color_gradation_list)))
					  color_object (vlax-create-object (strcat "AutoCAD.AcCmColor." (substr (getvar 'acadver) 1 2)))
				)
				(foreach ename 3dface_ename_list
					(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
						(progn
							(if smooth_gradation
								(setq rgb_color_list (get_mid_color (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale)
																	color_gradation_list
													 )
								)
								(setq rgb_color_list (nth (atoi (rtos (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale) 2 0))
														  color_gradation_list
													 )
								)
							)
							(vla-setrgb color_object (car rgb_color_list)
													 (cadr rgb_color_list)
													 (caddr rgb_color_list)
							)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
						(progn
							(vla-setrgb color_object 255 255 255)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
					)
				)
		)
		(
			t
				(princ "\nZ coodinates are equal")
		)
	)
	(foreach ename 3dface_ename_list
		(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z")
		)
	)
	(princ)
)

;*****************************************************************************************************************************************************************
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 13:07:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833798#M33077</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T13:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833804#M33078</link>
      <description>&lt;P&gt;as per different entities which you want to color due to theirs z value, there is no need to rewrite code for each of them. it is better be to change the code to gather z values for each different entity in different way.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 13:11:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833804#M33078</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T13:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833824#M33079</link>
      <description>Thank you for your quick response. Highly appreciated.</description>
      <pubDate>Mon, 20 Mar 2023 13:21:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833824#M33079</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-20T13:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833825#M33080</link>
      <description>&lt;P&gt;your welcome)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 13:22:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833825#M33080</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833941#M33081</link>
      <description>&lt;P&gt;code for different enames should go like this. no matter how do you select them,&amp;nbsp;each z coordinate for each ename will be treated independently for the whole selection set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;*****************************************************************************************************************************************************************

;	komondormrex, mar 2023

;*****************************************************************************************************************************************************************

(defun get_mid_color (color_value color_gradation_list / color_number)
	(setq color_number (atoi (rtos color_value)))
	(if (&amp;lt; color_number (1- (length color_gradation_list)))
		(mapcar '(lambda (color_1 color_2) (- color_1  (atoi (rtos (* (- color_value (fix color_value)) (- color_1 color_2)) 2 0))))
				 (nth color_number color_gradation_list)
				 (nth (1+ color_number) color_gradation_list)
		)
		(nth color_number color_gradation_list)
	)
)

;*****************************************************************************************************************************************************************

(defun c:a-la_z_gradient (/ color_gradation_list ename_list min_z_total average_z z_scale nth_z_scale color_object rgb_color_list smooth_gradation
							min_max_height_list
						 )
	(setq color_gradation_list '(  ; r   g   b
									(0   0   255)
									(0   95  255)
									(0   205 255)
									(0   255 160)
									(30  255 0)
									(215 255 0)
									(255 225 0)
									(255 185 0)
									(255 100 0)
        							(255 0   0)
						   		)
;		  min_max_height_list '(-10 -4)
;		  smooth_gradation t
		  ename_list (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "3dface,text,line,point,lwpolyline"))))))
	)
	(cond
		(
			(or
				(= "TEXT" (cdr (assoc 0 (entget (car ename_list)))))
				(= "POINT" (cdr (assoc 0 (entget (car ename_list)))))
			)
				(setq min_z_total (cadddr (assoc 10 (entget (car ename_list))))
					  max_z_total min_z_total
				)
		)
		(
			(= "3DFACE" (cdr (assoc 0 (entget (car ename_list)))))
		  		(setq min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget (car ename_list))))) 4.0)
		  			  max_z_total min_z_total
				)
		)
		(
			(= "LWPOLYLINE" (cdr (assoc 0 (entget (car ename_list)))))
		  		(setq min_z_total (cdr (assoc 38 (entget (car ename_list))))
		  			  max_z_total min_z_total
				)
		)
		(
			(= "LINE" (cdr (assoc 0 (entget (car ename_list)))))
				(setq min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11))) (entget (car ename_list))))) 2.0)
					  max_z_total min_z_total
				)
		)
	)
	(foreach ename ename_list
		(cond
			(
				(or
					(= "TEXT" (cdr (assoc 0 (entget ename))))
					(= "POINT" (cdr (assoc 0 (entget ename))))
				)
					(setq average_z (cadddr (assoc 10 (entget ename))))
			)
			(
				(= "3DFACE" (cdr (assoc 0 (entget ename))))
			  		(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget ename)))) 4.0))
			)
			(
				(= "LWPOLYLINE" (cdr (assoc 0 (entget ename))))
			  		(setq average_z (cdr (assoc 38 (entget ename))))
			)
			(
				(= "LINE" (cdr (assoc 0 (entget ename))))
					(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11))) (entget ename)))) 2.0))
			)
		)
		(cond
			(
				min_max_height_list
					(cond
						(
							(and
								(&amp;gt;= average_z (car min_max_height_list))
								(&amp;lt;= average_z (cadr min_max_height_list))
							)
								(vlax-ldata-put ename "Average_Z" average_z)
						)
						(
							t
						)
					)
			)
			(
				t
					(vlax-ldata-put ename "Average_Z" average_z)
					(if (&amp;lt; average_z min_z_total) (setq min_z_total average_z))
					(if (&amp;gt; average_z max_z_total) (setq max_z_total average_z))
			)
		)
	)
	(if min_max_height_list
		(setq min_z_total (car min_max_height_list)
			  max_z_total (cadr min_max_height_list)
		)
	)
	(setq z_scale (* 1e3 (- max_z_total min_z_total)))
	(cond
		(
			(not (zerop z_scale))
				(setq nth_z_scale (/ z_scale (1- (length color_gradation_list)))
					  color_object (vlax-create-object (strcat "AutoCAD.AcCmColor." (substr (getvar 'acadver) 1 2)))
				)
				(foreach ename ename_list
					(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
						(progn
							(if smooth_gradation
								(setq rgb_color_list (get_mid_color (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale)
																	color_gradation_list
													 )
								)
								(setq rgb_color_list (nth (atoi (rtos (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale) 2 0))
														  color_gradation_list
													 )
								)
							)
							(vla-setrgb color_object (car rgb_color_list)
													 (cadr rgb_color_list)
													 (caddr rgb_color_list)
							)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
						(progn
							(vla-setrgb color_object 255 255 255)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
					)
				)
		)
		(
			t
				(princ "\nZ coodinates are equal")
		)
	)
	(foreach ename ename_list
		(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z")
		)
	)
	(princ)
)

;*****************************************************************************************************************************************************************&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:18:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11833941#M33081</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-20T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839227#M33082</link>
      <description>&lt;P&gt;My God&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt; This is becoming the Holy Grail to my Color Grading Problem.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;you have done an out-standing job with this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The one and only limitation (I would not dare to call it a drawback at this stage) now is that if I select an upper and lower limit for elevation, the entities out of this range become white (255,255,255). &lt;STRONG&gt;(Screenshot attached)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per my work requirements, it would be a lot better if all the entities with elevation greater than the upper limit become the same as the top-color (RED-in this case), and all those with elevation less than the lower limit become the same as the bottom-color (BLUE-in this case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I certainly realize that I have already taken a lot of your time on this one, but if you can spare some time to resolve this I would be extremely thankful.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 13:27:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839227#M33082</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-22T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839300#M33083</link>
      <description>&lt;P&gt;you got it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;*****************************************************************************************************************************************************************

;	komondormrex, mar 2023

;*****************************************************************************************************************************************************************

(defun get_mid_color (color_value color_gradation_list / color_number)
	(setq color_number (atoi (rtos color_value)))
	(if (&amp;lt; color_number (1- (length color_gradation_list)))
		(mapcar '(lambda (color_1 color_2) (- color_1  (atoi (rtos (* (- color_value (fix color_value)) (- color_1 color_2)) 2 0))))
				 (nth color_number color_gradation_list)
				 (nth (1+ color_number) color_gradation_list)
		)
		(nth color_number color_gradation_list)
	)
)

;*****************************************************************************************************************************************************************

(defun c:a-la_z_gradient (/ color_gradation_list ename_list min_z_total average_z z_scale nth_z_scale color_object rgb_color_list smooth_gradation
							min_max_height_list count_index
						 )
	(setq color_gradation_list '(  ; r   g   b
									(0   0   255)
									(0   95  255)
									(0   205 255)
									(0   255 160)
									(30  255 0)
									(215 255 0)
									(255 225 0)
									(255 185 0)
									(255 100 0)
        							(255 0   0)
						   		)
;		  min_max_height_list '(-10 -4)
;		  smooth_gradation t
		  ename_list (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "3dface,text,line,point,lwpolyline"))))))
	)
	(cond
		(
			(or
				(= "TEXT" (cdr (assoc 0 (entget (car ename_list)))))
				(= "POINT" (cdr (assoc 0 (entget (car ename_list)))))
			)
				(setq min_z_total (cadddr (assoc 10 (entget (car ename_list))))
					  max_z_total min_z_total
				)
		)
		(
			(= "3DFACE" (cdr (assoc 0 (entget (car ename_list)))))
		  		(setq min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget (car ename_list))))) 4.0)
		  			  max_z_total min_z_total
				)
		)
		(
			(= "LWPOLYLINE" (cdr (assoc 0 (entget (car ename_list)))))
		  		(setq min_z_total (cdr (assoc 38 (entget (car ename_list))))
		  			  max_z_total min_z_total
				)
		)
		(
			(= "LINE" (cdr (assoc 0 (entget (car ename_list)))))
				(setq min_z_total (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11))) (entget (car ename_list))))) 2.0)
					  max_z_total min_z_total
				)
		)
	)
	(foreach ename ename_list
		(cond
			(
				(or
					(= "TEXT" (cdr (assoc 0 (entget ename))))
					(= "POINT" (cdr (assoc 0 (entget ename))))
				)
					(setq average_z (cadddr (assoc 10 (entget ename))))
			)
			(
				(= "3DFACE" (cdr (assoc 0 (entget ename))))
			  		(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11 12 13))) (entget ename)))) 4.0))
			)
			(
				(= "LWPOLYLINE" (cdr (assoc 0 (entget ename))))
			  		(setq average_z (cdr (assoc 38 (entget ename))))
			)
			(
				(= "LINE" (cdr (assoc 0 (entget ename))))
					(setq average_z (/ (apply '+ (mapcar 'cadddr (vl-remove-if-not '(lambda (group) (member (car group) '(10 11))) (entget ename)))) 2.0))
			)
		)
		(cond
			(
				min_max_height_list
					(cond
						(
							(and
								(&amp;gt;= average_z (car min_max_height_list))
								(&amp;lt;= average_z (cadr min_max_height_list))
							)
								(vlax-ldata-put ename "Average_Z" average_z)
						)
						(
							t
								(if (&amp;lt; average_z (car min_max_height_list))
									(vlax-ldata-put ename "Average_Z_min" average_z)
								)
								(if (&amp;gt; average_z (cadr min_max_height_list))
									(vlax-ldata-put ename "Average_Z_max" average_z)
								)
						)
					)
			)
			(
				t
					(vlax-ldata-put ename "Average_Z" average_z)
					(if (&amp;lt; average_z min_z_total) (setq min_z_total average_z))
					(if (&amp;gt; average_z max_z_total) (setq max_z_total average_z))
			)
		)
	)
	(if min_max_height_list
		(setq min_z_total (car min_max_height_list)
			  max_z_total (cadr min_max_height_list)
		)
	)
	(setq z_scale (* 1e3 (- max_z_total min_z_total)))
	(cond
		(
			(not (zerop z_scale))
				(setq nth_z_scale (/ z_scale (1- (length color_gradation_list)))
					  color_object (vlax-create-object (strcat "AutoCAD.AcCmColor." (substr (getvar 'acadver) 1 2)))
					  count_index 0
				)
				(foreach ename ename_list
					(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
						(progn
							(if smooth_gradation
								(setq rgb_color_list (get_mid_color (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale)
																	color_gradation_list
													 )
								)
								(setq rgb_color_list (nth (atoi (rtos (/ (* 1e3 (- (cdr (assoc "Average_Z" (vlax-ldata-list ename))) min_z_total)) nth_z_scale) 2 0))
														  color_gradation_list
													 )
								)
							)
							(vla-setrgb color_object (car rgb_color_list)
													 (cadr rgb_color_list)
													 (caddr rgb_color_list)
							)
							(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
							(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
						)
						(progn
							(if (assoc "Average_Z_min" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
								(progn
									(vla-setrgb color_object (car (car color_gradation_list))
															 (cadr (car color_gradation_list))
															 (caddr (car color_gradation_list))
									)
									(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
									(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
								)
							)
							(if (assoc "Average_Z_max" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
								(progn
									(vla-setrgb color_object (car (last color_gradation_list))
															 (cadr (last color_gradation_list))
															 (caddr (last color_gradation_list))
									)
									(vla-put-colormethod (vla-get-truecolor (vlax-ename-&amp;gt;vla-object ename)) accolormethodbyrgb)
									(vla-put-truecolor (vlax-ename-&amp;gt;vla-object ename) color_object)
								)
							)
						)
					)
					(princ (strcat "\rOf " (itoa (length ename_list)) " selected entities processed: " (itoa (setq count_index (1+ count_index)))))
				)
		)
		(
			t
				(princ "\nZ coodinates are equal")
		)
	)
	(foreach ename ename_list
		(if (assoc "Average_Z" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z")
		)
		(if (assoc "Average_Z_min" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z_min")
		)
		(if (assoc "Average_Z_max" (vlax-ldata-list (vlax-ename-&amp;gt;vla-object ename)))
				(vlax-ldata-delete (vlax-ename-&amp;gt;vla-object ename) "Average_Z_max")
		)
	)
	(princ)
)

;*****************************************************************************************************************************************************************&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Mar 2023 13:51:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839300#M33083</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-22T13:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839492#M33084</link>
      <description>&lt;P&gt;This is Ultimate. You cannot imagine to what extents this is going to be useful for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know about your faith and beliefs&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13423916"&gt;@komondormrex&lt;/a&gt;&amp;nbsp;, but I pray that may God strengthen your knowledge and may it be useful for you and everyone that needs it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Salute!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 14:55:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11839492#M33084</guid>
      <dc:creator>Yasir.Aman</dc:creator>
      <dc:date>2023-03-22T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Color 3DFace entities according to their Z-value. (modify existing lisp code)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11841202#M33085</link>
      <description>&lt;P&gt;thank you) and you are very welcome)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 06:36:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/color-3dface-and-polyline-text-or-point-entities-according-to/m-p/11841202#M33085</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-03-23T06:36:45Z</dc:date>
    </item>
  </channel>
</rss>

