Read Raster Image Correlation file through vba

Read Raster Image Correlation file through vba

Anonymous
Not applicable
1,693 Views
7 Replies
Message 1 of 8

Read Raster Image Correlation file through vba

Anonymous
Not applicable

Hello All,

I have tons of zip files (more than 10-20k) and every zip contains dwg, image file and .res file.

I'm in process of writing a routing which will open each drawing from each zip and embed the raster and convert it to PDF. That all part works well I'm stuck on one particular scenario where the image and .res file are present but not attach to dwg. To tackle this I need to add small routine which will insert the raster as per parameters stated in .res file.

I'm very well aware of how to insert raster via VBA but I couldn't see any provision to read the parameters from .res file.

 

.res file is raster image correlation file, which hold the information about the image file such as insertion point, scale, rotation, layer etc.

 

Regards,

Deepak

0 Likes
1,694 Views
7 Replies
Replies (7)
Message 2 of 8

norman.yuan
Mentor
Mentor

I never used *.res file as you described. Is the content of the file is in plain text, or it is not read-able binary format? If it is plain text format, you just need to write data from file to parse the text to get needed information. Otherwise, you may have to use the program that creates it to read it, I am afraid.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 8

Anonymous
Not applicable

.res is not plain text file. it's complied file. 

See attached zip file for you info. zip file contains dwg , image and .res file. if you open the dwg file you will not see any image attached to it. But when you follow the insert image option from raster menu system will automatically detects the .res file which has information about correct insertion points, scale etc for the image.

 

0 Likes
Message 4 of 8

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

which software created that res-file?

As it is binary you might need a tool or library function to access the content of that file.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 8

Anonymous
Not applicable

res file created by autocad when we export the raster image from autocad.

as you mentioned it needs library function to access/use via VBA. I tried using ACADRaster class but it doesn't have any function for .res file usage.

0 Likes
Message 6 of 8

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> res file created by autocad when we export the raster image from autocad

Oh, never have seen that ... as I never export TIFF files from AutoCAD using RasterDesign.

Sorry not to know a solution for this.

 

It might help to ask in the forum about RasterDesign >>>here<<<

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 8

Ed__Jobe
Mentor
Mentor

I checked the Raster Design ActiveX api and it doesn't have a method for reading the res file. All you can do is use it while loading an image.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 8 of 8

Anonymous
Not applicable

Yes, I know. I also found other object library called "Autodesk Raster Object 5.1" which you can refer to VBA project.

So I did refer it in my project and when I looked at it from object browser found that it talks about CADOverlay object and can see some option there for correlation property. Tried to create object and simulate properties with different ways but nu success so far. Appreciate if anyone can give me hand with it.

0 Likes