- ;;BY 龙龙仔(LUCAS)
- ;;如何不打开一个图(只选择)就能得到哪个图纸的图层的资讯;;得到了图层的资讯,你就会了吗? (defun REGISTEROBJECTDBX (/ DBXSERVER) ;by Tony Tanzillo
- (cond
- ((vl-registry-read
- "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument\\CLSID"
- )
- )
- ((not (setq DBXSERVER (findfile "AxDb15.dll")))
- (alert "Error: Can't locate ObjectDBX Library (AxDb15.dll)")
- )
- (t
- (startapp "regsvr32.exe" (strcat "/s "" DBXSERVER """))
- (or
- (vl-registry-read
- "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument\\CLSID"
- )
- (alert
- "Error: Failed to register ObjectDBX ActiveX services."
- )
- )
- )
- )
- )(defun C:TT (/ DWGNAME APP DOC BLOCKS DBXDOC LAYERS LAYERS_LIST)
- (vl-load-com)
- (setq DWGNAME (getfiled "选取图档" (getvar "dwgprefix") "dwg" 8))
- (setq APP (vlax-get-acad-object))
- (setq DOC (vla-get-activedocument APP))
- (if (> (atoi (getvar "AcadVer")) 15)
- (setq DBXDOC (vla-getinterfaceobject
- APP
- "ObjectDBX.AxDbDocument.16"
- )
- )
- (progn
- (if (not (REGISTEROBJECTDBX))
- (exit)
- )
- (setq DBXDOC (vla-getinterfaceobject
- APP
- "ObjectDBX.AxDbDocument"
- )
- )
- )
- )
- (vla-open DBXDOC (findfile DWGNAME))
- (setq LAYERS (vla-get-layers DBXDOC))
- (vlax-for LAY LAYERS
- (setq LAYERS_LIST
- (append LAYERS_LIST (list (vla-get-name LAY)))
- )
- )
- (mapcar 'vlax-release-object (list APP DOC DBXDOC LAYERS))
- (acad_strlsort LAYERS_LIST)
- )
|