Author Topic: create a bitmap file from a selection set  (Read 1873 times)

0 Members and 1 Guest are viewing this topic.

BrianM

  • Guest
create a bitmap file from a selection set
« on: December 03, 2012, 03:28:42 PM »
Can someone point me in the correct direction to create a bitmap file from a selection set in Acad 2013.
I'm working on a program that resizes the acad window, then performs a zoom extents, and allows the user to select the objects to create a bitmap image.

I can get the current acad window to resize to the correct size, however, I'm having trouble finding any info on creating a bmp from a selection set.

thanks
brian

zoltan

  • Guest


BrianM

  • Guest
Re: create a bitmap file from a selection set
« Reply #3 on: December 03, 2012, 10:34:41 PM »
Thanks for the links. I have already seen a couple of those, but I'm not sure I can use that code with a selection set. I'm not creating a bmp from all objects in the drawing. The bmp is created only from the objects selected by the user.

Here's the code I currently have. I've noted with a comment where I need to create the bmp. I beleive I could do this with COM, but I would rather find a way to do this with managed code.

Code - vb.net: [Select]
  1.  Public Sub Main()
  2.  
  3.             Dim doc As Document = Application.DocumentManager.MdiActiveDocument()
  4.             Dim ed As Editor = doc.Editor
  5.             Dim docWindow As Window = doc.Window
  6.  
  7.             docWindow.WindowState = Window.State.Normal
  8.  
  9.             Dim size As System.Drawing.Size = docWindow.GetSize
  10.  
  11.             ed.WriteMessage(vbCrLf + "Document Size:" + vbCrLf + size.ToString() + vbCrLf)
  12.  
  13.             Dim newSize As System.Drawing.Size = New System.Drawing.Size(950, 573) 'was 608
  14.  
  15.             docWindow.SetSize(newSize)
  16.  
  17.             ZoomExtents()
  18.  
  19.             '' Select objects in the drawing area
  20.             Dim ssPrompt As PromptSelectionResult = ed.GetSelection()
  21.  
  22.             '' If the prompt status is OK, objects were selected
  23.             If ssPrompt.Status = PromptStatus.OK Then
  24.                 Dim acSSet As SelectionSet = ssPrompt.Value
  25.  
  26.                
  27.  
  28.                 'This is where I want to export the selection set to a bmp file
  29.  
  30.             End If