anyone can help ?
thanks in advance
Mike,
at this stage, I think we've all understood that you need a lisp to detach, purge and atach the same xref file...
Would be useful, if you provide more details...
As a demo:
(defun c:test () (command "-xref" "_D" "YourXrefName" "_.purge" "all" "" "_N" "-xref" "_A" "YourXrefPath" "TheInsertionPoint" "Xscale" "Yscale" "RotationAngle") )
Where:
"YourXrefName" -> "drawing01"
"YourXrefPath" -> "c:/path/path/drawing01.dwg"
"TheInsertionPoint" -> "0,0,0"
"Xscale" -> "1"
"Yscale" -> "1"
"RotationAngle" -> "0"
HTH
Henrique
thank you HMSilva
the problem is that i have a huge number of drawing and xrefs , thats why i was wondering if there any lisp routine that can copy the path and repath it after detaching and purging
hello 3wood , its not only about reloading xrefs
i need to detach and purge because i have this problem related to the visretain
where i cant get true xrefs color
and i cant change visretain because my linetypes will vary
Thank you all
A quick one, minimally tested:
(defun c:test (/ ENT HND I LST LST OBJ SS) (if (setq ss (ssget "_X" '((0 . "INSERT")))) (progn (repeat (setq i (sslength ss)) (setq hnd (ssname ss (setq i (1- i))) ent (entget hnd) obj (vlax-ename->vla-object hnd) ) (if (vlax-property-available-p obj 'Path) (if (findfile (vla-get-path obj)) (setq lst (cons (list (cdr (assoc 2 ent)) (vl-string-translate "\\" "/" (vla-get-path obj)) (cdr (assoc 10 ent)) (cdr (assoc 41 ent)) (cdr (assoc 42 ent)) (* 180.0 (/ (cdr (assoc 50 ent)) pi)) ) lst ) ) );; if );; if );; repeat (if lst (progn (foreach x lst (command "-xref" "_D" (car x)) );; foreach (repeat 3 (command "_.purge" "all" "" "_N") );; repeat (foreach x lst (command "-xref" "_A" (nth 1 x) (nth 2 x) (nth 3 x) (nth 4 x) (nth 5 x) ) );; foreach );; progn );; if );; progn );; if (princ) )
Hope that helps
Henrique
wow , amazing , genius
Thanks a lot Henrique
but there a little problem , all xrefs in model and layout were re attached in model
is there a way to attach each one were it is ?
or to add specifying option to specify one xref , so i can do it in the model for the xref that i want to re attach
thanks a lot
Mike,
here's the revised code:
(defun c:test (/ ENT HND I LST LST OBJ SS) (vl-load-com) (if (setq ss (ssget "_X" '((0 . "INSERT")))) (progn (repeat (setq i (sslength ss)) (setq hnd (ssname ss (setq i (1- i))) ent (entget hnd) obj (vlax-ename->vla-object hnd) ) (if (vlax-property-available-p obj 'Path) (if (findfile (vla-get-path obj)) (setq lst (cons (list (cdr (assoc 2 ent)) (vl-string-translate "\\" "/" (vla-get-path obj)) (cdr (assoc 10 ent)) (cdr (assoc 41 ent)) (cdr (assoc 42 ent)) (* 180.0 (/ (cdr (assoc 50 ent)) pi)) (cdr (assoc 410 ent)) ) lst ) ) );; if );; if );; repeat (if lst (progn (setq lst (vl-sort lst (function (lambda (a b) (< (nth 6 a) (nth 6 b)))))) (foreach x lst (command "-xref" "_D" (car x)) );; foreach (repeat 3 (command "_.purge" "all" "" "_N") );; repeat (foreach x lst (setvar 'CTAB (nth 6 x)) (command "-xref" "_A" (nth 1 x) (nth 2 x) (nth 3 x) (nth 4 x) (nth 5 x) ) );; foreach );; progn );; if );; progn );; if (princ) )
hope that helps
Henrique
hello Henrique ,
im sorry 😞 still have the same problem 😞
the xrefs are re attaching in the model , while i have xrefs in model , and legends , notes , title block in paper space
if i can select a single attach (wich i need to fix) it will be enough to me
i dont want to bother you and waste your time !!!
if i can select a single attach (wich i need to fix) it will be enough to me ,
i dont want to bother you and waste your time !!!
@mikecharbel wrote:
hello Henrique ,
im sorry 😞 still have the same problem 😞
the xrefs are re attaching in the model , while i have xrefs in model , and legends , notes , title block in paper space
Are you sure you're running the latest code?
Henrique
Mike,
to select a single xref, detach, purge and attach the same xref...
Today I don't have free time to rewrite the code, so
a quick and dirty...
(defun c:test (/ ENT HND LST OBJ SS) (vl-load-com) (prompt "\nSelect XREF to Detach, Purge and Attach: ") (if (setq ss (ssget "_+.:E:S" '((0 . "INSERT")))) (progn (setq hnd (ssname ss 0) ent (entget hnd) obj (vlax-ename->vla-object hnd) ) (if (vlax-property-available-p obj 'Path) (if (findfile (vla-get-path obj)) (setq lst (cons (list (cdr (assoc 2 ent)) (vl-string-translate "\\" "/" (vla-get-path obj)) (cdr (assoc 10 ent)) (cdr (assoc 41 ent)) (cdr (assoc 42 ent)) (* 180.0 (/ (cdr (assoc 50 ent)) pi)) ) lst ) ) );; if );; if (if lst (progn (foreach x lst (command "-xref" "_D" (car x)) );; foreach (repeat 3 (command "_.purge" "all" "" "_N") );; repeat (foreach x lst (command "-xref" "_A" (nth 1 x) (nth 2 x) (nth 3 x) (nth 4 x) (nth 5 x) ) );; foreach );; progn );; if );; progn );; if (princ) )
HTH
Henrique