Author Topic: Xref path help needed.  (Read 12209 times)

0 Members and 1 Guest are viewing this topic.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Xref path help needed.
« Reply #30 on: January 30, 2006, 06:35:51 AM »
Kerry
This works a treat on the I to P versions (it even seems to find the nested ones)

Thanks a bunch.

The title blocks wont be as simple. They were on the G\read only\cad\drawing templates, and they will be on the P drive, but in a protected area, this doesnt seem to repath those. How can I get it to find and repath them

Many thanks
T
Thanks for explaining the word "many" to me, it means a lot.

Glenn R

  • Guest
Re: Xref path help needed.
« Reply #31 on: January 30, 2006, 06:39:21 AM »
You can't permanently change the path of a nested xref. Code WILL change it in the host drawing, but as soon as the drawing is reloaded it will be back.
However, if you change the nested xrefs path in it's PARENT xref, that will work.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Xref path help needed.
« Reply #32 on: January 30, 2006, 06:40:42 AM »
Hi Tracey,

What is the path:name unresoved ; ie :

Resolve Xref "Drawing111": C:\Drawing111.dwg
"Drawing111.dwg" cannot be found.


.. and what is the NEW path:name

?


added:
.. and WHA ?

Quote
... but in a protected area
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Xref path help needed.
« Reply #33 on: January 30, 2006, 06:48:38 AM »
You can't permanently change the path of a nested xref. Code WILL change it in the host drawing, but as soon as the drawing is reloaded it will be back.
However, if you change the nested xrefs path in it's PARENT xref, that will work.

good advice.

Sounds like a job for Tracey's IT or Management guy !.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Xref path help needed.
« Reply #34 on: January 30, 2006, 07:37:09 AM »
Hi Tracey,

What is the path:name unresoved ; ie :

Resolve Xref "Drawing111": C:\Drawing111.dwg
"Drawing111.dwg" cannot be found.


.. and what is the NEW path:name

?


added:
.. and WHA ?

Quote
... but in a protected area

Dont worry for now Kerry. We need a protected (read only access) area to stop the engineers changing the titleblocks
Thanks for explaining the word "many" to me, it means a lot.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: Xref path help needed.
« Reply #35 on: January 30, 2006, 09:06:47 AM »
Is there any way that this lisp can be set to run on a batch of drawings?
Thanks for explaining the word "many" to me, it means a lot.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Xref path help needed.
« Reply #36 on: January 30, 2006, 09:28:49 AM »
Yep, just needs one line to load it and one for the command.

It's past pumpkin time here, so I'll leave help with that to the others  :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Xref path help needed.
« Reply #37 on: January 30, 2006, 11:23:47 AM »
To have it run on multiple drawings, I would make a script.  It would open then drawing, run the command, save the drawing, repeat on a list.  I wrote a routine to make a script and run it in This thread.

Hope that is useful.
Tim

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

Please think about donating if this post helped you.

hudster

  • Gator
  • Posts: 2848
Re: Xref path help needed.
« Reply #38 on: January 30, 2006, 11:38:55 AM »
Try this on a COPY of one of your drawings ..

I don't use Xrefs, so testing was limited, but seems to not explode in my face :-)

(ChangeXrefDrive "P:") < or whichever drive is new >

Code: [Select]
(defun ChangeXrefDrive (newDrive / xrefEdata)
  (mapcar
    '(lambda (blockName)
       (if
         (eq
           (logand
             4
             (cdr (assoc 70 (setq xrefEdata (entget (tblobjname "BLOCK" blockName))))
             )
           )
           4
         )
          (command "._XREF"
                   "PATH"
                   (cdr (assoc 2 xrefEdata))
                   (strcat newDrive (substr (cdr (assoc 1 xrefEdata)) 3))
          )
       )
     )
    (ai_table "BLOCK" 0)
  )
  (princ)

)

How would I change this so I could specify a new path, rather than just the drive letter?
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Xref path help needed.
« Reply #39 on: January 30, 2006, 12:05:51 PM »
How would I change this so I could specify a new path, rather than just the drive letter?
Code: [Select]
(defun ChangeXrefDrive (oldPath NewPath / xrefEdata tmpPath)
  (mapcar
    '(lambda (blockName)
       (if
         (eq
           (logand
             4
             (cdr (assoc 70 (setq xrefEdata (entget (tblobjname "BLOCK" blockName))))
             )
           )
           4
         )
          (if
           (and
            (/= (setq tmpPath (cdr (assoc 1 XrefEdata))) "")
            (= (strcase (vl-filename-directory tmpPath)) (strcase oldPath))
           )
           (entmod (subst (cons 1 (strcase NewPath (vl-filename-base tmpPath) ".dwg") (assoc 1 XrefEdata) XrefEdata))
          )
       )
     )
    (ai_table "BLOCK" 0)
  )
  (princ)

)
This should work.  The old path should not have the last slash, ie. c:\temp.
Tim

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

Please think about donating if this post helped you.