- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I generally have drawings with a cross marking a tree position and a line of text denoting the trunk girth, spread, height, and species.
The text is formatted as "tr-sp-h-spe" eg. "0.12-3.40-5.0-OAK"
I can then use the following Lisp routine to type in the tree information which will then draw a scaled tree with formatted info.
(defun c:tree ()
(command "osnap" "INSERT")
(setq xy (getpoint "Where? "))
(setq tr (getreal "Girth? "))
(setq sp (getreal "Spread? "))
(setq h (getreal "Height? "))
(setq spe (getstring "Species? "))
(command "osnap" "none")
(command "LAYER" "M" "TRTEXT" "")
(setq txy (polar xy 0.4636 0.894))
(command "TEXT" txy "" "" spe)
(command "TEXT" "" (strcat "G "(rtos tr 2 2)))
(command "TEXT" "" (strcat "S "(rtos sp 2 1)))
(command "TEXT" "" (strcat "H "(rtos h 2 0)))
(command "LAYER" "M" "TRTR" "")
(command "INSERT" "treebole" xy (/ tr PI) "" "" "")
(command "LAYER" "M" "TRCAN" "")
(command "INSERT" "trcan" xy sp "" "" "")
)
I'd like to be able to pick the position and then pick the text (instead of typing in all the info).
I know the text could be split into a list using the "-" as a delimiter, and that the numerical text could be converted to real numbers using "atof" which could then be used in the above routine instead of the "getreal" commands.
Problem is that my Lisp skills aren't up to actually writing the code...
Any help would be appreciated.
Thanks.
Solved! Go to Solution.