Jump to content

Recommended Posts

Posted

Hello all,

 

I am somewhat familiar with AutoCAD and LISP but I was just presented with a problem and I have no idea how to begin to attack it.

 

I have a series of 500+ DWG's that all contain .bmp images as xref's; however, I need to update the file extension to ".ecw" since the file size is drastically smaller (I have the images in both file types but at the time .bmp's were the only ones available).

 

So, I know I can create a selection set of all the images in the drawing, but I cannot figure out how to change the extension or where I even need to look for the "type".

 

Any help is appreciated!

Posted

Should look for DXF code 1:

(entget (cdr (assoc 340 (entget (car (entsel))))))

Posted

1st Have the bmp's been scaled and are the ecw the same size ?

 

2nd lisp to make list of the xref names and insert pt then delete bmp xref then xref in new ecw at old pt hint use dotted pairs (name . x,y)

 

maybe also xrefmanager

Posted

There is no need to delete the BMP reference, is just enough to replace file's path:

(setq assocImage (entget (cdr (assoc 340 theImageEntity))))
(setq pathOld (cdr (assoc 1 assocImage))
     pathNew (strcat (substr pathOld 1 (- (strlen pathOld) 3)) "ECW"))
(entmod (setq assocImage (subst (cons 1 pathNew)
                               (assoc 1 assocImage)
                               assocImage)))

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...