tasty geezer 发表于 2022-7-6 10:38:24

在“L8”例程中尝试以下操作:
 
这里有更多说明,尽管不如CADTutor(我试过):
 
http://lee-mac.com/runlisp.html

Lee Mac 发表于 2022-7-6 10:42:32

李Mac-L8。lsp工作出色。。。。非常感谢。
 
我要试试mpl2。现在是lsp。我是否需要将ALD块保存在特定的位置(例如在Autocad文件夹中)?

tasty geezer 发表于 2022-7-6 10:44:28

 
杰出的
 
 
按照我设计代码的方式,有三种方法可以在代码顶部指定块,具体取决于块图形文件所在的位置:
 
1) 完整文件名(例如“C:\\My Folder\\ALD\u Block.dwg”)-块图形文件可以在任何地方
 
2) .dwg(例如“ALD\u Block.dwg”)-块图形文件必须位于支持路径中(目前是这样)
 
3) (例如“ALD_块”)-块图形文件必须位于支持路径中

rkmcswain 发表于 2022-7-6 10:49:55

李-有可能拥有L8吗。lsp还将所有内容都转换为Bylayer。如果拱门或引擎指定了特定颜色而不是ByLayer,则不会更改颜色。只是好奇。

Lee Mac 发表于 2022-7-6 10:50:04

 
当然可以:
 
2
 
以上内容将所有不在列表图层上的对象更改为“ByLayer”-是否希望所有内容(包括列出的图层)都更改为“ByLayer”?

tasty geezer 发表于 2022-7-6 10:53:55

我只需要所有的东西,但我的图层变成了ByLayer(我相信我所有的图层都已经是ByLayer了)。我使用了修改后的L8。lsp,但它没有将层更改为ByLayer。我仍然在一些图层上使用颜色。我需要做些不同的事情吗?

Lee Mac 发表于 2022-7-6 10:57:36

tasty geezer 发表于 2022-7-6 11:02:34

Lee MAc - is it possible to have the L8.lsp also turn everything to Bylayer. If the arch or eng. assigned a specific color instead of ByLayer it will not change the color. Just curious.

Lee Mac 发表于 2022-7-6 11:03:28

 
Sure thing:
 

(defun c:L8 ( / NewCol layers def n c ss ) (vl-load-com) ;; © Lee Mac 2010 (setq NewCol;; New Colour for Objects (setq layers   (mapcar 'strcase    '(       ;; List your Layers Here (may use Wildcards):         "LC_*"      ;;------------------------------------------;;   )         ) ) (while (setq def (tblnext "LAYER" (null def)))   (setq n (strcase (cdr (assoc 2 def))) c (cdr (assoc 62 def)))      (if   (not       (vl-some         (function         (lambda ( s ) (wcmatch n s))         )         layers       )   )   (       (lambda ( tbl )         (entmod         (subst             (cons 62 (* NewCol (/ (abs c) c))) (assoc 62 tbl) tbl         )         )       )       (entget (tblobjname "LAYER" n))   )   ) ) (if   (setq ss   (ssget "_X"       (list         (cons -4 "")       )   )   )   (   (lambda ( i / e l )       (while (setq e (ssname ss (setq i (1+ i))))         (if (assoc 62 (setq l (entget e)))         (if             (setq l               (entmod               (subst                   (cons 62 256) (assoc 62 l) l               )               )             )             (entupd e)         )         )       )   )   -1   ) ) (princ));;-------------------=={ List to String }==-------------------;;;;                                                            ;;;;Constructs a string from a list of strings separating   ;;;;each element by a specified delimiter                     ;;;;------------------------------------------------------------;;;;Author: Lee Mac, Copyright © 2010 - www.lee-mac.com       ;;;;------------------------------------------------------------;;;;Arguments:                                                ;;;;lst - a list of strings to process                        ;;;;del - delimiter by which to separate each list element    ;;;;------------------------------------------------------------;;;;Returns:String containing each string in the list       ;;;;------------------------------------------------------------;;(defun LM:lst->str ( lst del ) ;; © Lee Mac 2010 (if (cdr lst)   (strcat (car lst) del (LM:lst->str (cdr lst) del))   (car lst) ))
 
The above changes all object NOT on your list layers to ByLayer - would you want EVERYTHING (including your listed layers) changed to ByLayer?

tasty geezer 发表于 2022-7-6 11:08:10

I would just need everything but my layers turn to ByLayer (I believe all of my layers are already ByLayer anyway). I used the revised L8.lsp, but it didn't change the layers to ByLayer. I still have color used on some of the layers. Do I need to do something different?
页: 1 [2]
查看完整版本: 回到CAD游戏中