不是百分之百确定你在寻找什么或这个lisp的目的,但这应该让你开始。
- (defun c:ADefXYZ (/ pointA pointB Ax Ay Az Bx By Bz)
- (setq pointA (getpoint "\nSpecify Point A: "));;Asks user to specify point
- (setq pointB (getpoint "\nSpecify Point B: "));;Asks user to specify point
- ;;(169.433 44.3076 0.0) This is a List of points ( X Y Z )
- (setq Ax (nth 0 PointA)) ;;selects the 1st variable in the list pointA
- (setq Ay (nth 1 PointA)) ;;selects the 2nd variable in the list pointA
- (setq Az (nth 2 PointA)) ;;selects the 3rd variable in the list pointA
- (setq Bx (nth 0 PointB)) ;;selects the 1st variable in the list pointB
- (setq By (nth 1 PointB)) ;;selects the 2nd variable in the list pointB
- (setq Bz (nth 2 PointB)) ;;selects the 3rd variable in the list pointB
- (entmake (list (cons 0 "LINE") ;; Creates a Line
- (cons 10 (list Ax Ay Az)) ;;1st point if you would not like to specify Az replace with 0.0
- (cons 11 (list Bx By Bz)) ;;2nd point if you would not like to specify Az replace with 0.0
- (cons 210 (list 0.0 0.0 1.0))))
- )
这与David的lisp基本相同,只是解释了更多。 |