Creates a new raster
image based on an existing image file.
VBA : RetVal =
VL : RetVal = (vla-AddRaster
object ImageFileName InsertionPoint
(vla-AddRaster mspace "c:/AfraLisp.jpg"
(vlax-3d-point IP) 1.0 0.0)
ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.
The full path and file name of the image.
Variant (three-element array of doubles); input-only
The 3D WCS coordinates in the drawing where the raster image will be
The raster image scale factor. The default image scale factor is 1.
The scale factor must be a positive number. You can set the scale of
the image to the scale of the geometry created in the AutoCAD
The rotation angle in radians for the raster image.
RetVal : Raster
The newly created Raster object.
Images placed through the
AddRaster method are not actually part of the drawing file. The raster
image is linked to the drawing file through a path name or document ID.
Linked image paths can be changed or removed at any time by using the
SupportPath property. By attaching images using linked image paths you
place images in your drawing without increasing the file size of the
You can add the same
raster image file to your drawing file multiple times. Each instance has
its own clip boundary and its own settings for brightness, contrast,
fade, and transparency. A single image can be cut into multiple pieces
that can be rearranged independently in your drawing.
(defun c:al-addRaster ()
(setq mspace (vla-get-modelspace
(setq IP (getpoint "\nInsertion Point: "))
;remember to substitute the path to your image.
(setq theraster (vla-AddRaster mspace
(vlax-3d-point IP) 1.0 0.0))