Matt__W 发表于 2009-6-17 09:28:57

使用VB选择图层

伙计们,我知道你们可以用特定的名称打开/关闭图层,但有可能在不知道图层名称的情况下这样做吗?

Matt__W 发表于 2009-6-17 10:09:04

您可以使用LIKE函数
    For Each lay In lays
      Set color = New AcadAcCmColor
      With color
            .ColorMethod = acColorMethodByACI
            .ColorIndex = "2"
      End With
      If UCase$(lay.Name) Like (("*") & ("ALIGN") & ("*")) Then   'This will freeze all layers that contain the word 'align'
                                                                  'Wildcards are used before and after the word
            lay.TrueColor = color
            lay.Freeze = False
            lay.LayerOn = True
      End If
    Next

Matt__W 发表于 2009-6-17 10:15:58

即#039;很酷,但是他们'我们想要的是,假设你有10个层,在不同的图形中命名不同,打开1&关闭其他选项,然后打开2&所有其他关闭,以此类推;正如第一次谈话后刚刚向我解释的那样:realmad:我喜欢软件开发中不断变化的规格。

Matt__W 发表于 2009-6-17 10:19:36

我不知道'我不太明白你为什么'我想这么做 但是好吧,多奇!

Matt__W 发表于 2009-6-17 10:42:14

我也是

Matt__W 发表于 2009-6-17 13:11:36


听起来像LAYWALK命令

Matt__W 发表于 2009-8-3 09:55:31


听起来像是LAYWALK命令,这是我看这篇文章的第一个想法
他真的需要把规格确定下来,然后再进一步做这件事。
页: [1]
查看完整版本: 使用VB选择图层