Author Topic: Fix xRef Paths on Mac  (Read 1031 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1443
Fix xRef Paths on Mac
« on: July 31, 2014, 05:59:39 PM »
I have been trying to find a way to fix xRef paths on the Mac.

I have gotten some code to work; however, it's a bit on the slow side, perhaps some people here can help me speed it up?

Code: [Select]
(defun c:FixWinPaths (/ tblitem WinPath MacPath)
(setq tblitem (tblnext "block" T)); Get xRefs
(while tblitem
(if (assoc 1 tblitem)
(progn
(setq WinPath (cdr (assoc 1 tblitem)))
(setq MacPath (vl-string-translate "\\" "/" (vl-string-subst "/Volumes/H Drive" "H:" WinPath)))
;(setq tblitem (subst '(1 . MacPath) (ASSOC 1 WinPath) tblitem))
(command "._-xref" "_Path" (cdr (assoc 2 tblitem)) MacPath)
)
)
(setq tblitem (tblnext "block"))
)
)
(defun c:FixMacPaths (/ tblitem WinPath MacPath)
(setq tblitem (tblnext "block" T)); Get xRefs
(while tblitem
(if (assoc 1 tblitem)
(progn
(setq MacPath (cdr (assoc 1 tblitem)))
(setq WinPath (vl-string-translate "/" "\\" (vl-string-subst "H:" "/Volumes/H Drive" MacPath)))
(command "._-xref" "_Path" (cdr (assoc 2 tblitem)) WinPath)
)
)
(setq tblitem (tblnext "block"))
)
)
Please bear in mind that there are vla functions available on the Mac.

You will notice that I was experimenting with the Subst function; however, I don't recall too well how to use it in this case, I know there would also need to be an entupd somewhere along the way. Any help that can be provided with this would be greatly appreciated.
« Last Edit: July 31, 2014, 06:11:45 PM by cmwade77 »