Author Topic: xref found path information?  (Read 4946 times)

0 Members and 1 Guest are viewing this topic.

hardeight

  • Guest
xref found path information?
« on: March 16, 2009, 04:37:25 PM »
I have been trying to find someone with some information on this subject. Is there any way in autolisp to access the found path, not the saved path, of an xref? I have been searching for info and keep coming up empty handed. Se7en tried to help me out on another forum and while he was one of the few who tried to help, he didn't know of a way to access what I was looking for either. here is what the scenario is...

Employees work on their personal edit drive they have write access to.
When a drawing is checked and signed off, I move it to the archive server that only I have write access too. Now, some of their drawings xref parts already on the archive server. So when I move the drawings over, The found path and the saved path are always the same. I am trying to make a database that keeps up with where every drawing is xrefed to. That way, whenever we change a standard part, we can check to see if it will effect any drawings that it is inserted into. I have that lisp written, the only problem is, I only seem to be able to access saved path information. So when I move a drawing folder over that has new basic parts that are xrefed, the found path changes to the new path but the saved path stays the old one. SO I was thinking just add a routine to the beginning of my lisp that updated all found paths and saved them to the saved path. Only problem is, I cant find this information anywhere.....

As of right now I am having to open up the drawing, open classicxref and save all my paths manually. I also tried to get a -classicxref dialog to use in a command statement, but I cant seem to get that to work either.
It would be easier to write a lisp that changes found paths to saved paths.

If anyone out there has any ideas, I would be very very thankful...

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: xref found path information?
« Reply #1 on: March 16, 2009, 04:43:21 PM »
you might have to test this, but I think if you set the path to the path it sees, it will make the saved path the found path.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: xref found path information?
« Reply #2 on: March 16, 2009, 04:50:10 PM »
This might be of some help.  Pointed out to me by Joe Burke.

Code: [Select]
(vlax-for i (vla-get-FileDependencies (vla-get-ActiveDocument (vlax-get-Acad-Object)))
    (if (= (vla-get-Feature i) "Acad:XRef")
        (princ (strcat "\n Xref file name [ path ]: " (vla-get-FileName i) " [ " (vla-get-FullFileName i) " ]"))
    )
)
(princ)

This is for the current opened drawing.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: xref found path information?
« Reply #3 on: March 16, 2009, 05:03:24 PM »
huh?! Would you look at that! ...Very nice!

Thats going into my library.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: xref found path information?
« Reply #4 on: March 16, 2009, 10:32:58 PM »
This might be of some help.  Pointed out to me by Joe Burke.

Code: [Select]
(vlax-for i (vla-get-FileDependencies (vla-get-ActiveDocument (vlax-get-Acad-Object)))
    (if (= (vla-get-Feature i) "Acad:XRef")
        (princ (strcat "\n Xref file name [ path ]: " (vla-get-FileName i) " [ " (vla-get-FullFileName i) " ]"))
    )
)
(princ)

This is for the current opened drawing.

oh man, i was just trying to figure this out. thank you so much!!!

i just needed a list of the names:
Code: [Select]
(defun XrefNameList (/ #List)
  (vlax-for i (vla-get-FileDependencies
(vla-get-ActiveDocument (vlax-get-Acad-Object))
      ) ;_ vla-get-FileDependencies
    (if (= (vla-get-Feature i) "Acad:XRef")
      (progn
(if (not #List)
  (setq #List (list (vl-filename-base (vla-get-FileName i))))
) ;_ if
(setq
  #List (cons (vl-filename-base (vla-get-FileName i)) #List)
) ;_ setq
      ) ;_ progn
    ) ;_ if
  ) ;_ vlax-for
  (if #List
    (acad_strlsort #List)
  ) ;_ if
) ;_ defun
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Joe Burke

  • Guest
Re: xref found path information?
« Reply #5 on: March 17, 2009, 10:18:22 AM »
The FileDependencies collection was added in ACAD 2004. So version checking may be needed...

ronjonp

  • Needs a day job
  • Posts: 7527
Re: xref found path information?
« Reply #6 on: March 17, 2009, 11:07:12 AM »
Alanjt,

You could shorten up your function like so. There is no need to check if the list exists.

Code: [Select]
(defun xrefnamelist (/ #list)
  (vlax-for i (vla-get-filedependencies (vla-get-activedocument (vlax-get-acad-object))) ;_ vla-get-FileDependencies
    (if (= (vla-get-feature i) "Acad:XRef")
      (setq #list (cons (vl-filename-base (vla-get-filename i)) #list)) ;_ setq
    ) ;_ if
  ) ;_ vlax-for
  (acad_strlsort #list)
) ;_ defun

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

hardeight

  • Guest
Re: xref found path information?
« Reply #7 on: March 17, 2009, 03:38:57 PM »
The FileDependencies collection was added in ACAD 2004. So version checking may be needed...

Yep. I have already discovered it isn't available in 2000. Is there an ARX add-on for something like these missing collections?

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: xref found path information?
« Reply #8 on: March 17, 2009, 08:12:36 PM »
Alanjt,

You could shorten up your function like so. There is no need to check if the list exists.

Code: [Select]
(defun xrefnamelist (/ #list)
  (vlax-for i (vla-get-filedependencies (vla-get-activedocument (vlax-get-acad-object))) ;_ vla-get-FileDependencies
    (if (= (vla-get-feature i) "Acad:XRef")
      (setq #list (cons (vl-filename-base (vla-get-filename i)) #list)) ;_ setq
    ) ;_ if
  ) ;_ vlax-for
  (acad_strlsort #list)
) ;_ defun


thanks so much ron, i didn't realize you didn't have to declare a list first.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

ronjonp

  • Needs a day job
  • Posts: 7527
Re: xref found path information?
« Reply #9 on: March 18, 2009, 12:28:49 PM »
Alanjt,

You could shorten up your function like so. There is no need to check if the list exists.

Code: [Select]
(defun xrefnamelist (/ #list)
  (vlax-for i (vla-get-filedependencies (vla-get-activedocument (vlax-get-acad-object))) ;_ vla-get-FileDependencies
    (if (= (vla-get-feature i) "Acad:XRef")
      (setq #list (cons (vl-filename-base (vla-get-filename i)) #list)) ;_ setq
    ) ;_ if
  ) ;_ vlax-for
  (acad_strlsort #list)
) ;_ defun


thanks so much ron, i didn't realize you didn't have to declare a list first.

 8-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC