thanx。。。
这就是我得到的:
- ;;;
- (defun C:describe ()
- ;;;Do the mapcar function for each layer in the drawing.
- (vlax-for layer
- (vla-get-layers
- (vla-get-activedocument
- (vlax-get-acad-object)
- )
- )
- ;;;if the current layer being checked matches a predetermined name, add the needed description.
- (mapcar
- (function
- (lambda (layname description)
- (if (= (strcase (vla-get-name layer)) (strcase layname))
- (vla-put-description layer description)
- ()
- )
- )
- )
- '("A-------O2-" ) ; This is your list of layers needing a description.
- '("arrow"); This is the descriptions for each layer. Make sure the order is EXACTLY the same as in the layer list.
- )
- )
- (princ); Silent exit.
- )
- (defun c:layercreation ()
- (if (tblsearch "LAYER" "A-------O2-")
- (command "_layer" "s" "A-------O2-" "")
- (command "-layer" "M" "A-------O2-" "C" "red" "A-------O2-" "")
-
- ) ; end if
-
- );en defun
- (defun c:inarrow ( / sl oldlay)
- (setq oldlay (getvar "clayer"))
- (setq sl nil)
-
- (setq sl (dos_dwgpreview "Choose arrows" "K:\\CAD\\\\block\\arrows"))
- (prompt "\nChoose insertion point")
- (if sl
- (progn
- (c:layercreation)
- (c:describe)
- (setvar "clayer" "A-------O2-")
- (command "-insert" sl pause "1" "1" "0")
- (setvar "clayer" oldlay)
-
- );progn
- );if
- (exit)
-
- )
Dos_dwgpreview有一个浏览按钮。
我不知道我是否可以禁用它。
这里的用户可以选择浏览到其他文件夹并选择其他块。
如果他这样做,那层仍然是一个----O2-。
如果不能禁用浏览按钮,我想要的是,如果用户选择转到另一个路径,或者层改为------O4-的路径。
这我做不到
我不知道怎么做。。什么是智能。
我有文件夹:
块
在此情况下:
箭
人
标度符号
汽车
每一个都是layerdependent。
汽车以一种------O1的形式出现-
人们可能在--------10-
在lisp上方插入一个带有层A的箭头------O2-。。。
我想如果用户更改目录,它会将一层添加到该目录中。。。
这很难做到吗?
Thanx公司 |