Batch processing
-
As mentioned previously, Viru Aithal, from DevTech India, has been working hard on a replacement for the venerable ScriptPro tool. I'm delighted to say that it's now ready, and is live on Autodesk Labs as November's Plugin of the Month. Viru took the codebase he developed for the DWF/PDF Batch Publish tool and created ScriptPro 2.0, written from the ground up in C# and developed without any dependency on a specific AutoCAD version. Viru's approach uses the equivalent of late binding to call into AutoCAD through COM and so doesn't require a specific AutoCAD Type Library. Which means the tool…
-
I had a very nice surprise in my inbox, this morning. Thorsten Meinecke, from GTB in Berlin, decided to convert the VB.NET code contained in the last post into an F# script and to share it with this blog's readership. Thanks, Thorsten! 🙂 One thing about it being an F# script (typically stored in a .fsx file) is that it can be loaded and executed directly from the "F# Interactive" (FSI) component in Visual Studio without the need to build it into a project creating an executable. What's also very nice is that the XAML defining the WPF dialog is…
-
A friend in our Product Support team in Neuchâtel asked me to help develop a little application to sort drawing files on disk. He has some old Clipper scripts that he used during a previous life as a CAD Manager to sort drawing files into different folders based on their version (held in the first six bytes of the DWG file, as mentioned in this previous post and this post of Shaan's). We decided I'd implement it in VB.NET, to make it easier for him to understand and extend. The application is simple enough, but could make a mess of…
-
I'm very pleased to announce the availability of this really interesting Plugin of the Month over on Autodesk Labs: Batch Publish for AutoCAD. Here's an excerpt from the ReadMe (which I happen to have written, but anyway): This plugin can be used with AutoCAD to simplify the process of publishing sets of drawings to DWF and/or PDF. It runs as a command within AutoCAD – as opposed to a separate executable – and uses a separate executable to monitor AutoCAD's health and restart it, as needed. The status of the batch publishing operation is stored to disk, allowing it to…
-
In this recent post we looked at an approach combining AutoLISP with a script generated on-the-fly to get around the fact that (command "_.OPEN" …) does nothing when SDI == 0. As mentioned in a comment in the post, I realised that the approach of using a single master script to do this is more prone to failure: a number of commands can cause scripts to stop executing, for instance, so it would be better practice to minimise the operations contained in a particular script to increase the application's fault tolerance. This modified approach was suggested by a member of…
-
As mentioned in this previous post, there has been some discussion internally around the future of SDI. Given the change this will bring to applications, SDI is going to be around until we next deliberately choose to break binary application compatibility (something we just did with AutoCAD 2010 and typically try to do only every three releases). That said, SDI is very likely to go away at some point, so it does seem worth drilling further into the reasons for using it and trying to determine an appropriate way to remove current dependencies on it. Thanks to all of you…
-
Thanks to all of your interest in this recent post, which looked at a way to interface an out-of-process .NET application with an assembly running in-process to AutoCAD. After some obvious functionality gaps were raised, Renze de Waal, one of our ADN members, pointed out a DevNote on the ADN website covering – and more completely addressing – this topic. Shame on me for not checking there before writing the post. Anyway, onwards and upwards… The information in the DevNote highlights some of the problems I and other people had hit with my previous code, mostly related to the fact…
-
Over on Beyond the Paper, Volker Joseph has posted a DWF Toolkit console application that can be used to batch-convert between the DWF and DWFx formats.
-
In the last post we looked at some code to programmatically purge Registered Application names from the drawing currently active in AutoCAD. In this post we take the "batching" code first used in this previous post and apply it to this problem. What we end up with is an additional command called PF which asks the user to specify a folder and then purges the RegApps from the DWGs in that folder, saving those files that end up being modified with the "_purged" suffix. One point to note is the use of the Database.RetainOriginalThumbnailBitmap property: as we're not making any…
-
This post finally takes the code last shown in this previous post, migrating it to use RealDWG to update a folder of DWGs without the need for AutoCAD to be installed on the system. A big thanks to Adam Nagy, a member of DevTech working from our Prague office, who turned around my request to convert the code to work with RealDWG in a matter of hours (if not minutes). Firstly I need to make it clear that this code will not run without both RealDWG installed (I'm using RealDWG 2007, as the file format didn't change between 2007 and…