Jump to content

Recommended Posts

Posted

Is there a way of detaching all unreferenced x-refs (jpegs, dwgs etc) from a drawing before opening?

I have various drawings that will hang for a period of time before opening or just won’t open at all. When I do get them open they always seem to have unreferenced x-refs that when I detach the X-refs, save the drawing and reopen it there is no delay.

I have AutoCAD 2008 (Full version) with a decent spec PC and I don’t have as big a problem opening the drawings although I do experience some delay. The problem mainly arises when the drawings are opened in LT on various other PC’s around the office. I have tried using the partial open option but this doesn’t always open to give me the option to detach x-refs. Does anyone have or know of a LISP routine that I can run on CAD (Full version) that will detach unreferenced x-refs before opening to overcome this problem?

Any help would be greatly appreciated

Thanks

Posted

Check out the Reference Manager, it is installed along with your normal AutoCAD, find it under Start > All Programs > Autodesk.

Posted

I have had a look at the reference manager as you suggested but it dosent allow me to delete the unreferenced images, drawings etc just respecify the paths. I would like to delete the unreferenced items rather that rereference them if possible.

Posted

Huh, I really did think that you could remove the xrefs through that, but I can't find it either.

 

I know that you can run a repair before you open a drawing, but I doubt that that will remove xrefs, but try it.

 

You can use a script to remove xrefs from multiple drawings in one session, but that still means that the drawings will be opened one by one even if its is scripted so you don't have to do it yourself. I am wondering if you still have to answer all the Missing-Shapefile-dialogue boxes though...

 

The script I am thinking of goes like this to detach all xrefs:

-xref

d

*

Posted

You can try something like this but i warn you that xrefs can be very "goofy" (you have been warned--test this on non-production drawings until you are SURE that it works like you want it to).

 

;; remove all UNREF'd external references
(while
 (setq entry (tblnext "block" (not entry)))
 (if (cdr (assoc 1 entry))
   (cond
     ((< (cdr (assoc 70 entry)) 32)
      (command "xref" "d" (cdr (assoc 2 entry)))))))

Posted

Thanks for the code. I am not really up to speed in LISP as I should be:unsure: Will try it and see if I can get anywhere with it. I found that using the reference manager and renaming the paths of the xrefs/images I was having trouble with to local drives allowed me to open the drawings. Is it possible to have a lisp routine to open reference manager and do this with one click of a button(rename the unreferneced paths)?

Posted

no.

 

 

 

 

 

Extra text so that vBulletin will let me post my answer.

Posted
Extra text so that vBulletin will let me post my answer.
Which is completely retarded since everyone gives the necessary short and to-the-point answer and just fill the missing characters with random text/smiley faces.
Posted

Extra text so that vBulletin will let me post my answer.

 

Which is completely retarded since everyone gives the necessary short and to-the-point answer and just fill the missing characters with random text/smiley faces.

 

 

Hilarious.

 

Also, nice routine Se7en. I recently did something similar using ActiveX, and yours is *much* more succinct!

 

I feel silly for not knowing the answer, so please forgive my ignorance (I may be overlooking the obvious)... Why use the nested cond statement beneath if?

 

For example:

 

(while
 (setq entry (tblnext "block" (not entry)))
 (if [color=red]([/color]and (cdr (assoc 1 entry))
          (< (cdr (assoc 70 entry)) 32)[color=red])[/color]
   (command "xref" "d" (cdr (assoc 2 entry)))))

Posted

Why use the nested cond statement beneath if?

 

For example:

 

(while
 (setq entry (tblnext "block" (not entry)))
 (if [color=red]([/color]and (cdr (assoc 1 entry))
          (< (cdr (assoc 70 entry)) 32)[color=red])[/color]
   (command "xref" "d" (cdr (assoc 2 entry)))))

 

Thank you.

 

Because any code you see me post is usually part of a larger routine that i striped for posting reasons; when i strip a part for posting i wont clean/optomize/etc.. My intension is to show you the method i use(ed). My COND wouldn't really hurt but your AND would work just fine...or if you wanted to use an IF (which i would use) would also be good too.

 

I think i said before that i write the code here at my company but you may not understand what that means so real quick: If we were to use number of lines of code (not really a good judge of worthwhileness of an application but it would be good enough for this quick statement) where the routines posted here are in the 100 lines range, mine are about the 500-1000 range. -e.g. i noticed a layer making routine a little bit ago which was about 80-100 lines; my layer making routine is a little over 800. So, when you see something goofy like that you can either count on me creating a condition where i can quickly add to code --my use of COND over IF-- or i just sniped it out of a larger one.

 

Sorry that explanation was kind of choppy but its almost 2.00 here and i haven't had lunch yet so i kinda rushed it.

Posted

Because any code you see me post is usually part of a larger routine that i striped for posting reasons; when i strip a part for posting i wont clean/optomize/etc..

 

 

How silly of me :oops:... Thanks for the polite reminder, Se7en.

 

Only after reading your first couple lines of your response did I then remember that you have made this clear to me in another thread recently. It was not my intention to ask that you repeat yourself (yet again).

 

As I have only been coding for a handful of months, I sometimes fail to understand what one must go through to provide snippets, as I do not have an extensive extensive library (Size on disk: 1.68 MB not compiled).

 

I have a lot going on right now, and I must come across incredibly forgetful at the moment.

 

Sorry that explanation was kind of choppy but its almost 2.00 here and i haven't had lunch yet so i kinda rushed it.

 

 

No worries, it's almost 3:00 here and I haven't eaten today either... I have a Snickers in front of me, and have yet to open it!

 

Again, many thanks for your patience, and the succinct routine above. :wink:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...