AutoCAD-Slide-Library-Manager
AutoCAD-Slide-Library-Manager copied to clipboard
AutoCAD Slide Library Manager
Autodesk Slide Library Manager Application ( SLM )
Slm is a utility which helps you to create, edit, and manage AutoCAD slide libraries. It can read any version of AutoCAD slides, or slide libraries. It can also read any slide format (platform dependent such as UNIX, MAC, INTEL), and convert them into PNG transparent images.
The WPF Slide Control
The ‘Slide' control is a WPF control which displays slides under Windows platforms. It can be used by any other WPF application. It exposes three objects which are:
- SlideObject - which gives you access to 'slides'. I.e. SLD
- SlideLibObject - which gives you access to Slide Libraries. I.e. SLB
- SlideCtrl - the control itself
Install using NuGet:
- Create a Wpf Application
- Project -> Manage NuGet Packages...
- Search and Install 'AutoCAD Slide Control' package
or if the package does not show use the console
- Create a Wpf Application
- Tools -> NuGet Package Manager -> Package Manager Console
- On the console, enter: Install-Package AutoCAD.Slide.Control
SlideObject
This class gives you access to 'slide' object.
- Add the following line to your code
using Autodesk.AutoCAD.Windows; - You can now use the SlideObject class.
Example
using Autodesk.AutoCAD.Windows;
SlideObject sld = new SlideObject(@"MySlide.sld");
BitmapImage renderBitmap = sld.Export();
PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(renderBitmap)); // Push the rendered bitmap to it
using (FileStream outStream = new FileStream(@"MySlide.png", FileMode.Create)) // Create a file stream for saving image
{
encoder.Save(outStream);
}
SlideLibObject
This class gives you access to 'slide library' object.
- Add the following line to your code
using Autodesk.AutoCAD.Windows; - You can now use the SlideLibObject class.
Example
using Autodesk.AutoCAD.Windows;
SlideLibObject slb = new SlideLibObject(@"acad.slb");
SlideObject sld = slb._Slides["ZIGZAG"];
sld.SaveAs("ZIGZAG.sld");
is equivalent to
using Autodesk.AutoCAD.Windows;
SlideObject sld = SlideLibObject.LoadSlideFromLibrary(@"acad.slb", "ZIGZAG");
sld.SaveAs("ZIGZAG.sld");
SlideCtrl
This control allows you to display AutoCAD Slides in a WPF application.
- Add the following line to your WPF Window xaml
xmlns:SlideCtrlNS="clr-namespace:Autodesk.AutoCAD.Windows;assembly=SlideCtrl"
- Insert the control in you window like this
<SlideCtrlNS:SlideCtrl x:Name="preview" />
Example
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
xmlns:SlideCtrlNS="clr-namespace:Autodesk.AutoCAD.Windows;assembly=SlideCtrl"
>
<Grid>
<SlideCtrlNS:SlideCtrl x:Name="preview" SlideFileName="MySlide.sld" />
</Grid>
</Window>
using Autodesk.AutoCAD.Windows;
SlideObject sld = new SlideObject(@"MySlide.sld");
preview.Slide = sld;
or
using Autodesk.AutoCAD.Windows;
preview.SlideFileName = @"MySlide.sld";
License
Autodesk Slide Control / Slide Library Manager Application are licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Written by
Cyrille Fauvel
Autodesk Developer Network
Autodesk Inc.
http://www.autodesk.com/adn