马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 newer 于 2017-12-11 10:57 编辑
- ;; Returns a list of Xref filenames attached to the drawing
- ;; bIncludeFullPath = T - Full file path is returned
- ;; bIncludeFullPath = nil - Filename and extension only are returned
- ;; Usage: (XD::DOC:XrefPathsList T)
- ;; Usage: (XD::DOC:XrefPathsList nil)
- (defun XD::DOC:XrefPathsList (bIncludeFullPath / ent val fullName fileName fileList)
- ; Get the first element of the Blocks symbol table
- (setq ent (tblnext "block" T))
- ; Step through the Blocks symbol table
- (while ent
- ; Check for the DXF group code 1
- (if (setq val (assoc 1 ent))
- (progn
- ; Get the xref path name from the DXF group
- (setq fullName (cdr val))
- ; Determine whether the filename is returned only or the full path
- (if bIncludeFullPath
- (progn
- ; Check for a relative path and attempt to resolve the path
- (setq fileName (XD::FILE:ResolveRelativePath fullName (vl-string-trim "\\" (getvar "dwgprefix"))))
- )
- ; Return the filename and extension only
- (setq fileName (strcat (vl-filename-base fullName) (vl-filename-extension fullName)))
- )
- ; Append the filename to the list
- (setq fileList (cons fileName fileList))
- )
- )
- ; Return the next block in the Block symbol table
- (setq ent (tblnext "block"))
- )
- ; Return a sorted list of filenames
- (vl-sort fileList '<)
- )
|