;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xref-relative-path-lisp/td-p/4792859
;; Changes xref path types from absolute to relative
;; Functions by:
;; Henrique Moreira da Silva - 2014
;; Lee Mac - 2011
;;
;;
)
(LM:XRef:Full->Relative
)
)
)
)
)
;;-------------=={ Full Path to Relative Path }==-------------;;
;; ;;
;; Converts a Full XRef path to a Relative Path. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; dir - Directory of the Drawing in which the Xref resides ;;
;; path - Full Xref Path ;;
;;------------------------------------------------------------;;
;; Returns: Relative XRef Path ;;
;;------------------------------------------------------------;;
(defun LM:XRef:Full
->Relative
( dir path
/ p q
) )
path
)
)
(LM:Xref:Full
->Relative
(substr dir
(+ 2 p
)) (substr path
(+ 2 q
))) )
)
)
path
)
(LM:Xref:Full
->Relative
(substr dir
(+ 2 p
)) (strcat "..\\" path
)) )
( (LM:Xref:Full
->Relative
"" (strcat "..\\" path
))) )
)