全宏工作室 发表于 2002-10-24 00:22:00

图形字典

请教老师一下,怎样透过 AutoLISP 取出图形字典 layerstatedictionary 里面的数据?谢谢!

南子 发表于 2002-10-25 23:32:00

层的状态在tablesearch、tablenext函数试试。

龙龙仔 发表于 2002-10-28 08:14:00

Try this example

(vl-load-com)
(defun GET-STATENAMES (/ COLLECTION NAMES)
(if (not
        (vl-catch-all-error-p
          (setq        COLLECTION
               (vl-catch-all-apply
                   (function (lambda ()
                             (vla-item (vla-getextensiondictionary
                                           (vla-get-layers
                                             (vla-get-activedocument
                                             (vlax-get-acad-object)
                                             )
                                           )
                                       )
                                       "ACAD_LAYERSTATES"
                             )
                             )
                   )
               )
          )
        )
      )
    (vlax-for ITEM COLLECTION
      (print(entget (vlax-vla-object->ename item)))
      (setq NAMES (cons (strcase (vla-get-name ITEM)) NAMES))
    )
)
)

LIULISHENG 发表于 2018-2-1 09:53:01

龙龙仔好强大
页: [1]
查看完整版本: 图形字典