Jump to content
Soazyvix

Changing color of blocks according to elevation attribute

Recommended Posts

Soazyvix

Hi everyone,

I imported some bathymetric coordinates to AUTOCAD map 3d, they appeared as individual blocks, the numbers with a centered cross. I kept only the elevation attribute, adjusting size and position. After that, I had some issues, following:

 

I have to put them into a map, in different sizes and rotation angles according to the place, I made different blocks, separating above 10 meters and below 10 meters, because of the position of the numbers (have to be centered, matching the comma with the cross, and they vary depending on the numbers - 1 and 2 digits), and the blocks got mixed in their properties (size and color). I left them like that for a while, because I did manually, but I'm trying to solve this with some routine or queries.

 

I also need to classify the different depths with colors, according to the location. Is there a way to do it? Is it better to change from blocks to text? I'm trying to do a query for that, but is not working for blocks or text, I guess I am doing something wrong. Could you please, help me? Thanks in advance.

Share this post


Link to post
Share on other sites
BIGAL

It would be simple to change the color of text just read the text value and apply the correct color. You may be able to use a field. can you psot a dwg

Share this post


Link to post
Share on other sites
Soazyvix

Hi, there are thousands of numbers. That's why I'm trying to work with blocks and queries, if it's possible. Follows a sample attached[ATTACH=CONFIG]56794[/ATTACH][ATTACH=CONFIG]56794[/ATTACH]

Share this post


Link to post
Share on other sites
ReMark

It would probably be easier to test any proposed solutions if you were to attach an actual copy of the .DWG file. Images, in most cases, are just pretty pictures and that's about it.

Share this post


Link to post
Share on other sites
BIGAL

CIV3D does nice rainbows as a contour option.

Share this post


Link to post
Share on other sites
Soazyvix

Hi, I send an example. The numbers in black are the minimum zone depth and all the blue values which are below this should have red color, according to the stated for the zone.

Is there a way to do this at once? A lisp/query/etc.?

Thanks in advance

Share this post


Link to post
Share on other sites
BIGAL

Try this

 

; change color of a block
; by Alan H Feb 2016 


(vl-load-com)
(defun c:rlred ( / rl len x val)

(setq rl (atof (vla-get-textstring 
        (vlax-ename->vla-object 
        (car (entsel "Pick rl"))))))


(setq ss1 (ssget (list (cons 0 "INSERT")(cons 2 "Map_Survey_Point"))))
(setq len (sslength ss1))
(setq x len)
(repeat len
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 (setq x (- x 1)) )) 'getattributes)
(setq val (atof (vla-get-textstring att)))
(if (< val rl)
(vla-put-color att 10)
)
)
)
(command "regen")
)
(C:rlred)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×