谢谢,它解决了一个问题,但是出现了一个新问题。。。它继续处理新文件的旧文件实例。基本上,lisp应该这样工作:
使用基点复制->选择文本(将其用作保存新文件的名称)->打开新文件->使用0,0和中心粘贴->另存为dxf(使用原始文件中的名称)->关闭。
- ;;please make it works!
- (defun c:test1 ()
-
-
- (vl-load-com)
- ;;Copy with a base point
- (progn
- (command "copybase" (setq pnt1 (getpoint "\nZaznacz lewy dolny rog ramki ISO: ")) (ssget) "")
- )
- ;;Point the new dxf name
- (SETQ Match (NENTSEL "\nSelect Attribute or Text: "))
- (command "chprop" Match "" "color" "t" "100,100,100" "")
- (IF (= Match NIL)(ALERT "Please Select Attribute or Text..."))
- (IF (/= NIL Match)
- (PROGN
- (SETQ Match (ENTGET (CAR Match)))
- )
- )
- ;;open new file
- (vla-activate (vla-add (vla-get-documents (vlax-get-acad-object)) templateName))
直到那一刻,一切都在进行中。另一部分也适用,但在旧文件中
- ;;paste at 0,0 and center
- (command "pasteclip" "0,0")
- (command "zoom" "a")
- ;;save as dxf
- (command "filedia" "0")
- (IF(SETQ Text(CDR(ASSOC 1 Match)))
- (command "saveas" "dxf" "v" "r12" "" Text)
- )
- (command "filedia" "1")
- (command "purge" "a" "*" "n")
- (command "close" "n")
- )
另外,如果你能告诉我-我可以在哪里学习如何连接2个或更多的Lisp在一起,因为我很确定,连接我创建的4个独立的Lisp(复制、新建、粘贴、保存)比尝试编写一个长代码更容易。。。
谢谢你的帮助,
cad\u lisps\u noobish\u编写器 |