- ;;;
- ;;;先手工加载所需线型,然后运行gettype函数,得到当前加载的所有线型,记录在msg变量中。
- ;;;再手工删除加载的所有线型,运行puttype函数,将MSG变量中的线型加载。
- ;;;linetype对话框已经显示加载了的线型,
- ;;;可为何程序加载的线型不可以使用?(defun c:gettype();;; 这个范例搜寻线型集合,
- ;;; 列出集合中所有可用的线型 (VL-LOAD-COM) (setq AcadObject(vlax-get-acad-object) AcadDocument(vla-get-ActiveDocument Acadobject) mSpace(vla-get-ModelSpace Acaddocument) );;; 返回激活文件的线型集合对象 (setq LinetypeSel(vla-get-Linetypes AcadDocument));;; 列出所有可用的线型 (setq msg '()) (VLAX-FOR entry LinetypeSel (setq msg(cons (vla-get-Name entry) msg)) ) (princ))(defun c:puttype() (VL-LOAD-COM) (setq AcadObject(vlax-get-acad-object) AcadDocument(vla-get-ActiveDocument Acadobject) mSpace(vla-get-ModelSpace Acaddocument) );;; 在线型集合中搜寻DashDot 线型 (setq found :vlax-false) (setq LinetypeSel(vla-get-Linetypes AcadDocument)) (while (setq linetypeName (car msg) msg (cdr msg));;;msg全局变量 (VLAX-FOR entry LinetypeSel (if (= (vla-get-Name entry) linetypeName) (setq found :vlax-true) ) ) (if (= found :vlax-false) (vla-load LinetypeSel linetypeName "acad.lin") )
- )
- (princ))
|