Author Topic: Inserting a Raster that is already loaded  (Read 2483 times)

0 Members and 1 Guest are viewing this topic.

zoltan

  • Guest
Inserting a Raster that is already loaded
« on: February 28, 2007, 10:55:03 AM »
I'm having trouble inserting multiple instances of a raster without creating multiple references in the External References manager.

In AutoCAD 2007, I can attach an image with VLA-AddRaster and everytime I attach the same image path, it creates a new attachment in the references manager  The usually have the name OAImg2127129200 with the string of number different every time.   I can rename the reference with VLA-Put-Name, and it shows up in the references manager.  What I can't seem to do is insert another reference of the same name, so that they can be unloaded or detached together instead of as separate references.

Here's a little test function:
Code: [Select]
(Defun c:TestImage ( / sImagePath pntInsert oImage )
 (VL-Load-COM )
 (SetQ sImagePath (GetFileD "Select Image" "" "BMP" 0) )

 (While (SetQ pntInsert (GetPoint "\nPick Point"))
  (SetQ oImage
        (VLA-AddRaster
         (VLA-Get-Modelspace (VLA-Get-ActiveDocument (VLAX-Get-Acad-Object)) )
         sImagePath
         (VLAX-3D-Point pntInsert )
         1.0
         0.0
        )
  )
;;;  (VLA-Put-Name oImage "test" ) ;this won't work!
;;;  (VLA-Update oImage )
 )

 (TerPri )
 (Prin1 )
)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Inserting a Raster that is already loaded
« Reply #1 on: February 28, 2007, 04:13:33 PM »
what about copying the image file?  then it should be 1 reference to file, but multiple references in the dwg file
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)

zoltan

  • Guest
Re: Inserting a Raster that is already loaded
« Reply #2 on: February 28, 2007, 07:46:47 PM »
Yea... copying it works, but my images will be nested in blocks so the next block I create I would have to dig a copy out of another block definition.  It's possible, just a real pain!