thiof2000 Posted December 14, 2015 Posted December 14, 2015 hi ymg, they always come in red the arrows and values. where do I need to modify to have them CECOLOR bylayer? Quote
ymg3 Posted December 15, 2015 Posted December 15, 2015 (edited) thiof, What you want to do is to change color of individual attribute based on its value. Changing the color of the layer won't help you. Try this bit of code by hmsilva that I modified a little so it changes color only when value is greater than a given aximum Deviation. Notes that the blocks are not exploded or bursted, we change independantly the color of each attribute. ;; Original Code by hmsilva ; ;; http://forums.autodesk.com/t5/autocad-2013-2014-2015-2016/ ; ;; lisp-to-change-attribute-text-color/td-p/5570681 ; ;; ; ;; Modified by ymg to change color only when the attribute value exceed ; ;; a Maximum Value entered by user. ; ;; ; (defun c:test (/ blk col i ss) (setq tol (getreal "\nMaximum Allowable Deviation...?")) (if (and (princ "\nSelect blocks to change attributes color: ") (setq ss (ssget "_A" '((0 . "INSERT") (2 . "Compare_*") (66 . 1)))) (setq col (acad_colordlg 1)) ) (repeat (setq i (sslength ss)) (setq blk (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (foreach att (vlax-safearray->list (vlax-variant-value (vla-getattributes blk)) ) (if (and (vlax-write-enabled-p att) (> (atoi (vla-get-textstring att)) tol) ) (vla-put-color att col) ) ) ) ) (princ) ) Actually we could integrate this in the compare routine and do the coloring as we compare. ymg Edited December 15, 2015 by ymg3 Quote
thiof2000 Posted December 15, 2015 Posted December 15, 2015 that would be awesome to integrate it Quote
saw Posted January 14, 2017 Posted January 14, 2017 It's not so difficult task. Add path to four "block" files to Tools>Options>Tab 'Files', 'Support files search path'. ***** EDIT ****** Please redounload files. That was some errors. Thank you Very much Sir. Quote
saw Posted March 21, 2018 Posted March 21, 2018 Hi there, i can use this LSP well with civil3d 2012. But can not use with civil3d 2017. keep asking attributes to add value. may be coding missing some line. i don't know. please help. thanks million Quote
saw Posted March 21, 2018 Posted March 21, 2018 Can i Have your LISP file which can get the piling as built deviation? Thanks Quote
GNolder Posted May 30, 2023 Posted May 30, 2023 On 12/11/2015 at 3:22 PM, ymg3 said: thiof, Here I've cleaned up the code and added up a few "Bells and Whistles", however you need Express Tools installed for the progress bar to be operationnal and the program to run. The Red Circles have been replaced by Red Squares of the same size as the Search Aperture. Blocks have prefix name "Compare", the layers are now "Compare_Tags" and "Compare_Values" A little report is given in the Alert Box at end of processing. Notes in the example below the negative number on paired entities. Probably means that some of the points are duplicated. So Enjoy! ymg compare V1.0.LSP 14.08 kB · 68 downloads YMG, This is a very usefule routine. Can it be modified to use my block? I do survey as-built drawings for anchor bolts. About half of the drawings I do are not rotated true north (for presentation of final asbuilt). I also show 2 decimal places in decimal feet. Drawing file attached. Check paper space for notes. "tolerance" block is already inserted in my drawing. Please let me know if you can help. Thanks! test compare lisp.dwg tolerance.dwg Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.