用visual lisp 对CAD进行二次开发如何获取你所创建的字体样式的个数,求教各位大神
展开全部
;列出所创建的字体样式名
(defun c:ztgs()
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq styles (vla-get-TextStyles doc))
(princ (strcat "\n共创建了" (itoa (1- (vla-get-count styles))) "个字体样式, 名称如下:"))
(vlax-for style styles
(setq name (vla-get-name style))
(if (/= name "Standard")
(princ (strcat "\n字体样式名:" name))
)
)
(princ)
)
(defun c:ztgs()
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq styles (vla-get-TextStyles doc))
(princ (strcat "\n共创建了" (itoa (1- (vla-get-count styles))) "个字体样式, 名称如下:"))
(vlax-for style styles
(setq name (vla-get-name style))
(if (/= name "Standard")
(princ (strcat "\n字体样式名:" name))
)
)
(princ)
)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询