I am trying to create LISP to show 3D point to show as a block reference in civil3D. But I couldn't figure out how to make new point into a block reference that includes text showing the elevation.
Here is the code I have now:
(defun c:SetPointElevation (/ pt elevation)
;; Function to prompt for point and elevation, then set the elevation
(defun setElevation (pt elevation / newPt)
;; Create a new point with the given elevation
(setq newPt (list (car pt) (cadr pt) elevation))
;; Place the point in the drawing
(entmake (list '(0 . "POINT") '(100 . "AcDbEntity") '(100 . "AcDbPoint") (cons 10 newPt)))
;; Return the new point
newPt
;; Convert new point to block reference
(setq block (newPt))
)
;; User input to select a point
(setq pt (getpoint "\nSelect point: "))
;; User input for the new elevation
(setq elevation (getreal "\nEnter new elevation: "))
;; Call the function to set the elevation
(setq pt (setElevation pt elevation))
(princ (strcat "\nPoint set at elevation: " (rtos elevation 2 2)))
(princ)
)
(princ "\nType SetNew3DPoint to set the elevation for a point.")
(princ)