View Full Version : repathing nested xrefs
Hello everyone,
This is a two part question:
1. Is it possible to repath a nested xref without opening the parent xref?
2. If its possible how?
Recently one of our server was migrated from Novell to MS03, it caused a big mess with our xref paths. I wrote something that repathed all the parent xref and reloaded them but ran into a brick wall when it came to the nested xrefs. Any ideas on How I can remedy this?
Any suggestions will be appreciated.
Thanks
Vito
Can someone help me with this code?
This is what I have and it works great until it gets to the nested xrefs. What can I do to make handle nested xrefs as well.
(defun C:xrepath (/)
(setq ref (tblnext "block" t))
(while ref
(setq bit (cdr (assoc 70 ref)))
(if (= (logand 4 bit) 4)
(progn
(setq path (cdr (assoc 1 ref)))
(if (= (car (setq parsedpath (stringparse path ":"))) "G")
(progn
(setq newpath (strcat "U:\\NPC\\TD\\vol1" (nth 1 parsedpath)))
(setq xrefname (cdr (assoc 2 ref)))
(setq xref (ssget "x" (list (cons 0 "insert") (cons 2 xrefname))))
(setq ent (ssname xref 0))
(setq eobj (vlax-ename->vla-object ent))
(vlax-put-property eobj 'path newpath)
)
)
)
)
(setq ref (tblnext "block"))
)
(command "-xref" "r" "*")
(command "zoom" "e")
)
;;;************************************************************************************
;;; stringparse
;;; searches for a specified deliminator charter in a string
;;; arguements: str - string to be parsed
;;; delimiter - deliminating character to search for
;;; return: A list with the seperate strings as its elements
(defun stringparse (str Delimiter / SearchStr StringLen return n char)
(setq SearchStr Str)
(setq StringLen (strlen SearchStr))
(setq return '())
(while (> StringLen 0)
(setq n 1)
(setq char (substr SearchStr 1 1))
(while (and (/= char Delimiter) (/= char ""))
(setq n (1+ n))
(setq char (substr SearchStr n 1))
) ;_ end of while
(setq return (cons (substr SearchStr 1 (1- n)) return))
(setq SearchStr (substr SearchStr (1+ n) StringLen))
(setq StringLen (strlen SearchStr))
) ;_ end of while
(reverse return)
)
RobertB
2004-09-25, 02:54 PM
What version of AutoCAD? AutoCAD 2004 and 2005 install the external application Reference Manager. That was also an extension to 2002.
This application allows you to edit XRef paths externally of AutoCAD.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.