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:
(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 )
)