AutoCAD/3-d cad

Advertisement


Question
I have a site plan that has contours broken up. the contours are already 3-d, so that is good, but the contours are all one color. now i have worked with some one that had a command that  changed the color of a line according to the elevation of that line. do you know where i can find this or how i can make one myself? if i had this, it would make connecting the missing contour line much easier.

Answer
I answered this, but it appears that ALLEXPERTS has not record of it.  Here is code that I wrote for your problem of changing color to topo lines on different elevations:

(defun topocolrerr (msg)
  (command "_.undo" "_end")
  (if olderr (setq *error* olderr))
  (princ)
)

(defun c:topocolr ();(/ sset qty index ent elist elev)
  (setq olderr *error* *error* topocolrerr)
  (command "_.undo" "_g")
  (setq sset (ssget))
  (if sset (setq qty (sslength sset)))
  (setq index 0)
  (if qty
     (repeat qty
        (setq ent (ssname sset index))
        (setq elist  (entget ent))
        ;         (setq colr (cdr (assoc 62 elist)))
        (setq elev (cdr (assoc 38 elist)))
        (if (= (rem elev 2) 0.0 )(command "_.chprop" ent "" "c" "bylayer" ""))
        (if (= (rem elev 10) 0.0 )(command "_.chprop" ent "" "c" "6" ""))
        (setq index (1+ index))
     )
  )
  (command "_.undo" "_end")
  (setq *error* olderr)
  (princ)
)

Save the code to TOPOCOLR.LSP
Load with appload
Start by typing TOPOCOLR

Hope this helps
Bill DeShawn
http://my.sterling.net/~bdeshawn

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.