Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP for Grading

0 REPLIES 0
Reply
Message 1 of 1
kaizhi-chia
218 Views, 0 Replies

LISP for Grading

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)

Tags (2)
Labels (2)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report