Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you detach an image from AutoCAD

Status
Not open for further replies.

bm0078

Programmer
Jan 20, 2005
8
CA
I use VBA with AutoCAD 2002 and i would like to "detach" all images from 2280 drawing i have.

I know i must use "supportpath" to get it out of my drawing but don't know how?

Do you have a clue?
Thanks!
 
Hi bm0078,

Found this on AutoCAD's discussion forum:

Code:
Sub DeleteImage(ByVal sName As String)
  'This sub will erase the image named "sName" from the drawing an also will detach it.
  On Error GoTo NoSuchRaster
  ' Get the Image Dictionary.
  Dim oImageDictionary As AcadDictionary
  Set oImageDictionary = ThisDrawing.Dictionaries("ACAD_IMAGE_DICT")

  ' Get the raster definition
  Dim oImageDef As AcadObject
  Set oImageDef = oImageDictionary(sName)

  ' Erase the image's definition
  oImageDef.Delete

NoSuchRaster:
  'If there is any error, the raster does not exist.

  ' Destroy created objects
  Set oImageDictionary = Nothing
  Set oImageDef = Nothing
End Sub

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top