Jump to content

Piling As built


jason tay

Recommended Posts

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 by ymg3
Link to comment
Share on other sites

  • 1 year later...
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.:)

Link to comment
Share on other sites

  • 1 year later...

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

attachment.php?attachmentid=63540&cid=1&stc=1

tag.jpg

Link to comment
Share on other sites

  • 5 years later...
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

compare.png

 

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...