View Full Version : Labelling contour lines and spot elevations in AutoCAD 2007
bh.mccarthy
2007-03-11, 05:02 PM
Please Help!! My old office used Land Desktop and now I am really struggling to get my projects out on time in AutoCAD 2007. Does any one know how to efficiently insert proposed contour text? I also need to know what you would suggest in inserting proposed spot elevations? I made a block with attributes etc...but I had trouble when I needed to edit the text heights and symbols. When I changed the scale in the properties it threw them all off of their insertion point and when I went to the block editor it did not update them all. Any suggestions would be helpful. Thank you. ~B
Mike.Perry
2007-03-12, 05:45 AM
Hi B
Please note I have *moved* this thread from the AutoCAD Tips & Tricks (http://forums.augi.com/forumdisplay.php?f=180) forum to this one, as I feel this particular forum is a more appropriate place for such a topic.
Thanks, Mike
Forum Manager
Mike.Perry
2007-03-12, 05:56 AM
Hi
If you have not tried searching (http://forums.augi.com/search.php?) through the AutoCAD Support (http://forums.augi.com/forumdisplay.php?f=177) forums and AutoLISP (http://forums.augi.com/forumdisplay.php?f=91) forum, I suggest you give it a try... as this very subject / topic has been discussed on a few occasions (with workable answers / solutions provided).
Have a good one, Mike
Maverick91
2007-03-12, 03:47 PM
Please Help!! My old office used Land Desktop and now I am really struggling to get my projects out on time in AutoCAD 2007. Does any one know how to efficiently insert proposed contour text? I also need to know what you would suggest in inserting proposed spot elevations? I made a block with attributes etc...but I had trouble when I needed to edit the text heights and symbols. When I changed the scale in the properties it threw them all off of their insertion point and when I went to the block editor it did not update them all. Any suggestions would be helpful. Thank you. ~BAutoCAD doesn't have a function like LDT for labeling contours. Someone out there might have a LISP of VBA program or might come up with one to do that.
Would your new company be willing to buy you the tools you need?
keelay711
2007-03-12, 04:28 PM
Without doing a forum search myself, I had a couple thoughts on how to approach this:
If you contour lines are, in fact, at the correct 3D elevation, you can setup a field within the block to display the Z coordinate. If its all on a flat plane, you will have to edit in the elevation.
Make sure you block is defined according to the usc, with an identifiable insertion point. Perhaps the block is one attribute with text insertion at bottom center?
Select the contour line you want to annotate, and use the measure or divide command. When prompted for options, select the block option. It should insert the block all along the line at the appropriate angle.
For this application, it might be easiest to have multiple block containing only one text (not attribute) item, which is the elevation. That way, you can select the correct elevation directly from the measure/divide command.
Hope it helped.
ccowgill
2007-03-13, 11:49 AM
labeling objects that have elevations, I can help you with. This is the code I use:
;;===============================================
;; L o c a l F u n c t i o n s
;;===============================================
;; error function & Routine Exit
(defun *error* (msg)
(if
(not
(member
msg
'("console break"
"Function cancelled"
"quit / exit abort"
""
)
)
)
(princ (strcat "nError: " msg))
) ; endif
(restore_sys_vars) ; reset vars
)
;; Function to save system variables in global variable
;; call to function
;; (save_sys_vars '("CMDECHO" "CLAYER" "OSMODE" "CECOLOR"))
(defun save_sys_vars (lst)
(setq *sysvarlist* '())
(repeat (length lst)
(setq *sysvarlist*
(append *sysvarlist*
(list (list (car lst) (getvar (car lst))))
)
)
(setq lst (cdr lst))
)
)
;; Function to reset system variables
(defun restore_sys_vars ()
(repeat (length *sysvarlist*)
(setvar (caar *sysvarlist*) (cadar *sysvarlist*))
(setq *sysvarlist* (cdr *sysvarlist*))
)
)
(save_sys_vars
'("CMDECHO" "OSMODE" "CECOLOR" "CLAYER" "PICKBOX" "TEXTSTYLE")
)
;GET SYSTEM VAR & error handling
;SET SYSTEM VAR
(defun c:ca (/ ss elev th textobj)
(setvar "cmdecho" 0)
(setvar "osmode" 512)
(setq ss (getpoint "Select Contourn"))
(if ss
(progn
(setq elev (rtos (caddr ss))
th (* 0.06 40)
textobj (vla-addtext
acadModelSpace
elev
(vlax-3d-point ss)
TH
)
)
(vla-put-alignment textobj 10)
(vla-put-textalignmentpoint textobj (vlax-3d-point ss))
(vla-put-rotation textobj (* pi (/ 30.0 180.0)))
(c:ca)
) ;end progn
) ;end if
(*error* "") ;RESTORE SYSTEM VAR
(princ)
) ;end defun
This code works well for creating text at a particular angle on layers that pre-exist. Our office has adopted the policy that we need to trim the contour underneath the elevation, I haven't gotten around to it, because I really dont know how to go about doing it. Sorry I cant help with spot grades, if there is a surface model, I dont have the slightest Idea how to pull information from it. What software are you using to create the contours?
brett.burling
2007-03-16, 04:12 AM
.... you can setup a field within the block to display the Z coordinate...
Can you actually do that?
that is have a field within a block that references properties of the block itself?
keelay711
2007-03-22, 05:30 PM
Can you actually do that?
that is have a field within a block that references properties of the block itself?
That you can. I am working with something similar. The problem I face is trying to properly format the field to display the property properly. Assume the elevation you want to call out is the block's insert point. This point is defined by three values in drawing units, as you know. An unformated field will display these numbers "as is". So format to define only the Z coordinate. If your drawing units are in feet, you are done.
My problem lies is that our drawing units are in inches, forcing me to convert units and single out the one coordinate. I am currently experimenting with additional hidden fields to execute multiple calcuations/formats like this.
Hammer.John.J
2007-04-11, 03:58 PM
try the lisp attachment
it came from a discussion here
http://forums.augi.com/showthread.php?t=30263
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.