Some of the earliest adopters of Visio were engineers and others who created technical drawings, and they loved the combination of power and simplicity that Visio provides. One of the most ubiquitous applications used by engineers is Autodesk’s AutoCAD, and Visio supports AutoCAD files by providing basic CAD integration features for import, conversion, and export.
While we made significant CAD improvements in Visio 2007, we did not provide support for newer AutoCAD file formats. This meant that Visio 2007 users required saving their CAD files in older formats in order to open them in Visio.
Now in Visio 2010, we’ve addressed this issue by adding the ability to read the latest AutoCAD file formats while providing the same CAD functionality as Visio 2007.
To learn about Visio CAD support, we recommend reading our past blog posts about Visio 2007 linked below:
Please comment on the blog to let us know what you think.
When we talk to developers to get their feedback on the Visio development platform, a common request we hear is the ability, through the API, to control the settings used when exporting a diagram as a raster image in the PNG, JPG, BMP, or TIFF format. Typically, they want to automate the export of the pages in a document as images for use in a web page or other application that requires certain settings. In this post, we’ll talk about the additions to the Visio 2010 object model that let developers configure each of these raster export settings.
When you save a diagram in one of the raster formats, a dialog box appears to let you configure various settings, such as the color format, resolution, or size of the image. For example, this is the dialog for the PNG format:
Until now, there hasn’t been a way to automate the settings in this dialog via the API. In Visio 2010, we’ve enhanced the object model to make it possible to drive these settings programmatically using a set of new methods and properties on the ApplicationSettings object. You can use the methods to get and set the raster-export resolution and size, and you can use the properties to get and set raster export attributes such as data format, data compression, color reduction, color format, background color, transparency, and quality. You can use these methods and properties with the existing Page.Export and Selection.Export methods to export a diagram in a raster file format.
Here is the complete list of new raster export methods and properties on ApplicationSettings:
Returns the raster export resolution settings.
Gets the raster export size.
Specifies the raster export resolution settings.
Sets the raster export size.
Determines the background color that is applied to the exported image.
Determines the color format that is applied to the exported image.
Determines the color reduction that is applied to the exported image.
Determines the data compression algorithm that is applied to the exported image (BMP, TIFF).
Determines whether the exported image is interlaced or non-interlaced (PNG, GIF).
Determines the flip that is applied to the exported image.
Determines the export operation that is applied to the exported image (JPG only).
Determines the export quality that is applied to the exported image (JPG only).
Determines the rotation that is applied to the exported image.
Determines the transparency color that is applied to the exported image (PNG, GIF).
Determines whether Visio applies, to the exported image, the transparency color that is specified in the RasterExportTransparencyColor property (PNG, GIF).
For more details on these methods and properties, such as their parameters and constants, see the Visio Developer Reference in the Visio 2010 Beta.
This VBA code executes the settings in the PNG Output Options dialog box as shown above and exports the diagram as a PNG:
'Set the export resolution to the printer resolution at 600 x 600 pixels/inch Application.Settings.SetRasterExportResolution visRasterUsePrinterResolution, 600#, 600#, visRasterPixelsPerInch 'Set the export size to custom 8 x 5 inches Application.Settings.SetRasterExportSize visRasterFitToCustomSize, 8#, 5#, visRasterInch 'Set the data format to Interlace Application.Settings.RasterExportDataFormat = visRasterInterlace 'Set the color format to 24-bit color Application.Settings.RasterExportColorFormat = visRaster24Bit 'Rotate the image to the left Application.Settings.RasterExportRotation = visRasterRotateLeft 'Don’t flip the image Application.Settings.RasterExportFlip = visRasterNoFlip 'Set the background color Application.Settings.RasterExportBackgroundColor = 14798527 'Set the transparency color Application.Settings.RasterExportTransparencyColor = 13269045 'Use the transparency color Application.Settings.RasterExportUseTransparencyColor = True 'Export the active page as a PNG to the specified path Application.ActiveWindow.Page.Export "<drive>:\<path>\Network Diagram.png"
'Set the export resolution to the printer resolution at 600 x 600 pixels/inch Application.Settings.SetRasterExportResolution visRasterUsePrinterResolution, 600#, 600#, visRasterPixelsPerInch
'Set the export size to custom 8 x 5 inches Application.Settings.SetRasterExportSize visRasterFitToCustomSize, 8#, 5#, visRasterInch
'Set the data format to Interlace Application.Settings.RasterExportDataFormat = visRasterInterlace
'Set the color format to 24-bit color Application.Settings.RasterExportColorFormat = visRaster24Bit
'Rotate the image to the left Application.Settings.RasterExportRotation = visRasterRotateLeft
'Don’t flip the image Application.Settings.RasterExportFlip = visRasterNoFlip
'Set the background color Application.Settings.RasterExportBackgroundColor = 14798527
'Set the transparency color Application.Settings.RasterExportTransparencyColor = 13269045
'Use the transparency color Application.Settings.RasterExportUseTransparencyColor = True
'Export the active page as a PNG to the specified path Application.ActiveWindow.Page.Export "<drive>:\<path>\Network Diagram.png"
We hope these additions to the API for raster export open up some new possibilities for Visio developers, or at least make it easier and more efficient to build automated solutions. Let us know what you think by commenting on the blog or using Send a Smile.
In previous posts we've introduced Visio Services and shown you how you can publish your Visio diagrams to SharePoint. We've also given you a quick introduction on how to install and configure Visio Services. In this post, we'll cover more details for IT Administrators about running Visio Services in SharePoint 2010. This post contains lots of links to detailed documentation on TechNet as well as other blog posts.
Visio Services is implemented as a service application in SharePoint Server 2010. The service allows users to share and view Microsoft Visio Web drawings (*.vdw files). The service also enables viewing of data-connected web drawings, and the underlying data and drawing can be updated from various data sources. Drawings can be embedded in SharePoint pages using the Visio Web Access web part.
There are several ways in which you can build on top of Visio diagrams with Visio Services:
Because Visio Services is implemented as a service application, managing the service is simple through both SharePoint Central Administration and Windows PowerShell.
For detailed information about common administrative tasks, see the Visio Services Operations Guide.
Visio Services maintains a few performance and caching settings, as well as a list of trusted data providers. For more details, see this article that explains the various service settings.
Visio Services supports connecting to various data sources. Administrators need to understand how their organizations will use data with Visio Services and plan appropriately. The Visio Services Planning Guide will help you understand the implications of data connected web drawings.
By default, Visio Services supports connecting to the following data sources:
Administrators have the ability to control what data sources the service is allowed to connect to by managing the Trusted Data Providers.
Connecting a web drawing to SharePoint lists and Excel Services does not require any additional configuration.
To connect web drawings to external data sources (like SQL or an OLEDB data source), the administrator must setup an unattended service account with the Secure Store Service. The unattended account is a low-privilege domain account that is used by Visio Services when connecting to external data sources. The credentials for this account must be stored in a Secure Store target application, and Visio Services must know the name of this target application. For more information about the unattended account and the security implications of connecting to external data, and other authentication methods, see this article on Visio Services security.
Visio Services gives administrators a significant level of fine-grained control for the processing and displaying of Visio Web Drawings and what data sources they can connect to. This article on planning Visio Services security details the security implications that you should consider when deploying Visio Services.
The following is a list of resources that are available on TechNet for administrators planning to deploy Visio Services:
The following is a list of posts on this blog that contain more information about Visio Services:
We hope this overview and set of links will make it easy for IT administrators to deploy and use Visio Services. Let us know what you think by commenting on the blog or using Send a Smile.
Last week on the Office Engineering Blog, Microsoft confirmed the release dates for Visio 2010, Office 2010, SharePoint 2010, and Project 2010.
We’re happy to announce that Visio 2010 and the rest of the Office suite will release to manufacturing (RTM) next month.
Consumers who purchase and activate Office 2007 or Visio 2007 will be able to download corresponding Office 2010 or Visio 2010 products at no additional cost when they become available in June 2010.
All you need to be eligible for this program – Office 2010 Technology Guarantee – is the following:
For more information about the Office 2010 Technology Guarantee, and to sign up for an e-mail reminder when Office 2010 is available, visit www.office.com/techg.
As always, let us know in the comments if you have any questions or topics you’d like to see us discuss here in the future.