<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic vb.net saveas raster in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7796767#M27233</link>
    <description>&lt;P&gt;I have a VB.net routine that batch renames drawing files.The routine opens the file does a saveas. It works well except when it comes to external&amp;nbsp; references. I can live with the drawing references breaking. I am trying to do a ISAVEAS for the Raster Images. Cannot disable the file dialog. If Change the image name and imagedef files it insert the file unrotated&amp;nbsp; and unscaled.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 22:27:01 GMT</pubDate>
    <dc:creator>Jedimaster</dc:creator>
    <dc:date>2018-02-21T22:27:01Z</dc:date>
    <item>
      <title>vb.net saveas raster</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7796767#M27233</link>
      <description>&lt;P&gt;I have a VB.net routine that batch renames drawing files.The routine opens the file does a saveas. It works well except when it comes to external&amp;nbsp; references. I can live with the drawing references breaking. I am trying to do a ISAVEAS for the Raster Images. Cannot disable the file dialog. If Change the image name and imagedef files it insert the file unrotated&amp;nbsp; and unscaled.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 22:27:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7796767#M27233</guid>
      <dc:creator>Jedimaster</dc:creator>
      <dc:date>2018-02-21T22:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net saveas raster</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7797533#M27234</link>
      <description>&lt;P&gt;Sorry I did not think of -IMAGE command.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 23:09:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7797533#M27234</guid>
      <dc:creator>Jedimaster</dc:creator>
      <dc:date>2018-02-21T23:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net saveas raster</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7812392#M27235</link>
      <description>&lt;P&gt;Here is my solution&lt;/P&gt;
&lt;P&gt;' Get old raster name&lt;/P&gt;
&lt;P&gt;Sub GetRaster()&lt;BR /&gt; Dim CurrentSaveAsDrawing As String = Interaction.GetSetting("Autodesk Applications", My.Application.Info.Title, "CurrentSaveAsDrawing")&lt;BR /&gt; Dim ActiveDrawing As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt; ActiveDrawing.LockDocument()&lt;BR /&gt; Dim acTypValAr(0) As Autodesk.AutoCAD.DatabaseServices.TypedValue&lt;BR /&gt; acTypValAr.SetValue(New Autodesk.AutoCAD.DatabaseServices.TypedValue(Autodesk.AutoCAD.DatabaseServices.DxfCode.Start, "IMAGE"), 0)&lt;BR /&gt; Dim acSelFtr As Autodesk.AutoCAD.EditorInput.SelectionFilter = New Autodesk.AutoCAD.EditorInput.SelectionFilter(acTypValAr)&lt;BR /&gt; Dim ed As Autodesk.AutoCAD.EditorInput.Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor&lt;BR /&gt; Dim acSSPrompt As Autodesk.AutoCAD.EditorInput.PromptSelectionResult&lt;BR /&gt; acSSPrompt = ed.SelectAll(acSelFtr)&lt;BR /&gt; If acSSPrompt.Status = Autodesk.AutoCAD.EditorInput.PromptStatus.OK Then&lt;BR /&gt; Dim acSSet As Autodesk.AutoCAD.EditorInput.SelectionSet = acSSPrompt.Value&lt;BR /&gt; Using Trans As Autodesk.AutoCAD.DatabaseServices.Transaction = ActiveDrawing.Database.TransactionManager.StartTransaction&lt;BR /&gt; For Each selObj In acSSet&lt;BR /&gt; Dim MyImage As Autodesk.AutoCAD.DatabaseServices.RasterImage = Trans.GetObject(selObj.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, True)&lt;BR /&gt; Dim MyImageDef As Autodesk.AutoCAD.DatabaseServices.RasterImageDef = Trans.GetObject(MyImage.ImageDefId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, True)&lt;BR /&gt; Dim OriginalName As String = MyImage.Name&lt;BR /&gt; Dim OriginalActiveFileName As String = MyImageDef.ActiveFileName&lt;BR /&gt; Dim OriginalSourceFileName As String = MyImageDef.SourceFileName&lt;BR /&gt; Dim ImageExtension As String = System.IO.Path.GetExtension(OriginalActiveFileName)&lt;BR /&gt; Dim DestinationFile As String = Replace(CurrentSaveAsDrawing, ".dwg", ImageExtension, 1, -1, CompareMethod.Text)&lt;BR /&gt; System.IO.File.Copy(OriginalActiveFileName, DestinationFile, True)&lt;BR /&gt; Interaction.SaveSetting("Autodesk Applications", My.Application.Info.Title, "SaveAsImageFile", DestinationFile)&lt;BR /&gt; Next&lt;BR /&gt; End Using&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;' Apply new raster name&lt;BR /&gt;Sub Raster_Update()&lt;BR /&gt; Dim SaveAsImageFile As String = Interaction.GetSetting("Autodesk Applications", My.Application.Info.Title, "SaveAsImageFile")&lt;BR /&gt; Dim ACADApp As Autodesk.AutoCAD.Interop.AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;BR /&gt; ActiveDrawing.LockDocument()&lt;BR /&gt; Dim acTypValAr(0) As Autodesk.AutoCAD.DatabaseServices.TypedValue&lt;BR /&gt; acTypValAr.SetValue(New Autodesk.AutoCAD.DatabaseServices.TypedValue(Autodesk.AutoCAD.DatabaseServices.DxfCode.Start, "IMAGE"), 0)&lt;BR /&gt; Dim acSelFtr As Autodesk.AutoCAD.EditorInput.SelectionFilter = New Autodesk.AutoCAD.EditorInput.SelectionFilter(acTypValAr)&lt;BR /&gt; Dim ed As Autodesk.AutoCAD.EditorInput.Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor&lt;BR /&gt; Dim acSSPrompt As Autodesk.AutoCAD.EditorInput.PromptSelectionResult&lt;BR /&gt; acSSPrompt = ed.SelectAll(acSelFtr)&lt;BR /&gt; If acSSPrompt.Status = Autodesk.AutoCAD.EditorInput.PromptStatus.OK Then&lt;BR /&gt; Dim acSSet As Autodesk.AutoCAD.EditorInput.SelectionSet = acSSPrompt.Value&lt;BR /&gt; Using Trans As Autodesk.AutoCAD.DatabaseServices.Transaction = ActiveDrawing.Database.TransactionManager.StartTransaction&lt;BR /&gt; For Each selObj In acSSet&lt;BR /&gt; Dim MyImage As Autodesk.AutoCAD.DatabaseServices.RasterImage = Trans.GetObject(selObj.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, True)&lt;BR /&gt; Dim MyImageDef As Autodesk.AutoCAD.DatabaseServices.RasterImageDef = Trans.GetObject(MyImage.ImageDefId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, True)&lt;BR /&gt; MyImage.Name = System.IO.Path.GetFileNameWithoutExtension(SaveAsImageFile)&lt;BR /&gt; MyImageDef.SourceFileName = System.IO.Path.GetFileName(SaveAsImageFile)&lt;BR /&gt; MyImageDef.ActiveFileName = SaveAsImageFile&lt;BR /&gt; Next&lt;BR /&gt; Trans.Commit()&lt;BR /&gt; ACADApp.ActiveDocument.SendCommand("-IMAGE" &amp;amp; vbCr &amp;amp; "R" &amp;amp; vbCr &amp;amp; "*" &amp;amp; vbCr)&lt;BR /&gt; End Using&lt;BR /&gt; End If&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 13:40:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-saveas-raster/m-p/7812392#M27235</guid>
      <dc:creator>Jedimaster</dc:creator>
      <dc:date>2018-02-27T13:40:19Z</dc:date>
    </item>
  </channel>
</rss>

