使用AutoLisp重新定义块
我有一些插入块的Lisp。Lisp使用完整文件路径定位图形,然后插入。但是,如果图形中已存在同名块,Lisp将使用图形中的文件,而不是路径定义的文件。如果我使用标准的“插入”对话框浏览文件,然后尝试插入,如果我想重新定义它,我会收到提示。
如何在LISP中将此选项设置为redfine? 我有时使用vla insertblock插入块,这总是重新定义现有块。
PS>重新定义~对不起,我忍不住了。
你不会错过任何一个技巧。
你到底想要什么?
http://www.cadtutor.net/forum/showthread.php?t=40217
http://forums.augi.com/showthread.php?p=1035107
http://forums.augi.com/showthread.php?t=74579&highlight=blockredef
http://paracadd.com/lisp/lisp_lst.htm
;;;重新定义块并更新其属性
;;; *******************************************************************
;;; ATTREDEF。LSP
“重新定义”是给新手的。认真地认为我不介意被纠正。那不是那种类型我只是拼写错了哈哈
哇,我的代码真的到处都是。。。 我试过这个
(defun C:test ()
(vl-load-com)
(vla-insertblock (getpoint) "L:/DrawingUtilities/F-Part" 1 1 1 0)
)
但我发现了这个错误
错误:错误的参数类型:VLA-OBJECT(-85.2136 19.2445 0.0) 您看过Visual LISP帮助文件中的引用了吗?
您需要提供要插入块的块VLA对象(即模型/图纸空间、块定义)。
这一点需要是一个变体。
例如:
(defun InsertBlock (bNme Pt)
(vl-load-com)
;; Lee Mac~05.03.10
(vla-InsertBlock
(if (eq acPaperSpace
(vla-get-ActiveSpace
(setq doc (vla-get-ActiveDocument
(vlax-get-acad-object)))))
(if (eq :vlax-true (vla-get-MSpace doc))
(vla-get-ModelSpace doc)
(vla-get-PaperSpace doc))
(vla-get-ModelSpace doc))
(vlax-3D-point Pt) bNme 1. 1. 1. 0.))
(defun c:test (/ iPt file)
(if (and (setq iPt(getpoint "\nPick point for Block: "))
(setq file (findfile "L:\\DrawingUtilities\\F-Part.dwg")))
(InsertBlock file iPt))
(princ))
我确实看了帮助文件,我认为我做得对。我将学习afralisp VLisp教程。看到你们使用所有的vl-东西让我嫉妒。
我刚做了“开始”教程,我想这让我大吃一惊。
页:
[1]