谢谢大家的帮助!我根据帖子写下了我想要的东西。现在看起来是这样的:
- (defun c:DrawAB ( / pointA pointB Axx Ayy Azz Byy Bzz)
- (setq pointA (getpoint "\nSpecify Point A: "));;Asks user to specify point
- (setq pointB (getpoint "\nSpecify Point B: "));;Asks user to specify point
- (setq Axx (nth 0 PointA)) ;;selects the 1st variable in the list pointA
- (setq Ayy (nth 1 PointA)) ;;selects the 2nd variable in the list pointA
- (setq Azz (nth 2 PointA)) ;;selects the 3rd variable in the list pointA
- (setq Bxx (nth 0 PointB)) ;;selects the 1st variable in the list pointB
- (setq Byy (nth 1 PointB)) ;;selects the 2nd variable in the list pointB
- (setq Bzz (nth 2 PointB)) ;;selects the 3rd variable in the list pointB
- (setq P1 (list (* Axx -1) (* -1 Ayy))) ;;sets coords for p on plane (x-y)
- (setq P2 (list (* Axx -1) Azz)) ;;sets coords for p on plane (x-z)
- (setq T1 (list (* Bxx -1) (* -1 Byy))) ;;sets coords for T on plane (x-y)
- (setq T2 (list (* Bxx -1) Bzz)) ;;sets coords for T on plane (x-z)
- (command "line" P1 T1 "") ;;draws the line on plane (x-y)
- (command "line" P2 T2 "") ;;draws the line on plane (x-z)
- (command "insert" "tA1" P1 1 1 0) ;;inserts the mark for P on plane (x-y)
- (command "insert" "tA2" P2 1 1 0) ;;inserts the mark for P on plane (x-z)
- (command "insert" "tb1" T1 1 1 0) ;;inserts the mark for T on plane (x-y)
- (command "insert" "tb2" T2 1 1 0) ;;inserts the mark for T on plane (x-z)
- (princ)
- )
我现在去掉了“从原点的偏移”部分,因为我正在尽可能地保持基本,现在将保持原始世界UCS上的所有内容,包括轴方向(否定值的原因)。一旦绘图变得更高级,我将进一步研究它,因此仍然感谢未来的提醒。
我想用“xline”替换“line”,但每次都会出错(块没有插入到正确的位置,线不会引用2个点,而只是一个坐标)。关于扭曲值的xline命令,有什么我应该知道的吗?
干杯 |