Outside The Box blogs, Autodesk University anecdotes, articles, blog digests, and product news in chronological order. See Writing for the same material by subject.

OpenDCL Quick Intro

· LISP, Programming

If you’re an AutoLISP programmer, you’ve probably heard about OpenDCL. Maybe you’ve even checked it out, but it looked complicated and you weren’t sure whether it was worth the trouble to learn how to use it. Either way, do yourself a favor and spend 10 minutes to go through the following 10-step quick introduction to OpenDCL. Download and install OpenDCL Studio. Select the latest version in your desired language (ENU in the filename means US English). The download is an .msi file that can be cleanly uninstalled afterward.Start AutoCAD (2004 or later). Use the APPLOAD command to load _MasterDemo.lsp from the OpenDCL Studio samples folder (it will be located in a language subfolder of the main OpenDCL Studio folder). When you close the APPLOAD dialog, the OpenDCL ‘MasterDemo’ dockable form will appear.Click on the [ListView] button to run the ListView sample. The ListView sample is very simple and will demonstrate some basic principles of OpenDCL. Leave it running as you proceed through the following steps.Locate and open ListView.lsp in the OpenDCL Studio samples folder. ListView.lsp contains all the code for the ListView sample. Look for the c:ListViewDlg_Close_Clicked function defined near the end of that file. That function is called an “event handler”, and it is the lisp function that is executed when the [Close] button is pressed. The event handler for the [Close] button simply closes the dialog. The c:ListViewDlg_OnInitialize event handler function initializes the controls on the dialog before it is displayed.Locate and open ListView.odcl in the OpenDCL Studio samples folder. Files with an .odcl extension can be opened and edited in OpenDCL Studio. OpenDCL Studio is used to design the user interface elements in an OpenDCL project. In the project tree pane, open the ‘Modal Forms’ folder, then double click on ListViewDlg. The ListView form will be displayed in design mode.Click on the [Close] button on the ListView form. In the font toolbar at the top of the editor, press the [B] button to make the font bold. Notice that the button’s caption becomes bold. In the ‘Properties’ pane, double click on the ‘Height’ property value and change it to 20. Press [Enter] to apply the new value. Use your mouse to drag the bottom of the button in design view to resize it dynamically.Leaving OpenDCL Studio open, switch back to AutoCAD. Resize the ListView dialog, and notice how the controls it contains are also resized. Now switch back to OpenDCL Studio, make sure the [Close] button is selected, then click in the right column of the ‘(Wizard)’ property in the Properties pane (or right click on the button control and select ‘Properties’ in the control’s context menu). In the Control Properties Wizard, the Geometry tab shows that the button’s “Left Side Alignment” has been set to “Offset From Center of Dialog” and it’s “Top Side Alignment” has been set to “Offset From Bottom Edge”. Once these properties are set, no additional code is needed for the control to react correctly when the dialog is resized.Exit AutoCAD, then restart. Enter the OPENDCL command. This command demand-loads the OpenDCL Runtime using AutoCAD demand loading mechanism. The OpenDCL Runtime must be loaded before the OpenDCL functions will work. The OpenDCL Studio installation includes OpenDCL Runtime, so it already exists on your computer.If you are developing an application for use by others, you’ll need to download and distribute the OpenDCL Runtime along with your application. This is best done by incorporating the OpenDCL Runtime merge module for your language directly into your own application’s installation script. Alternatively, you can distribute the standalone OpenDCL Runtime .msi file for your language, or publish the URL where end users can download the latest version.Switch back to OpenDCL Studio and double click on the [Close] button control. Intelligent help displays all the properties, methods, and events of the selected control, including their AutoLISP syntax. Click on a property, method, or event in the left pane to see detailed information for it.Once you complete these ten steps, you are only a few minutes away from creating a fully functional OpenDCL application. Give it a try! …

Read

Ed Foster: Loss Of A Legend

· Personal, Industry

InfoWorld columnist and legendary consumer advocate Ed Foster died over the weekend. Ed was a tireless crusader for consumer rights in the digital age, and he will certainly be missed. For many years Ed has authored GripeLine (http://weblog.infoworld.com/gripeline/), where he called companies and politicians to task for abusive anti-consumer practices. I’ve written before about how Ed exposed and publicised shamefully lopsided software license agreements (http://www.gripe2ed.com/scoop/section/Eula), including Autodesk’s and Adobe’s. Recently, Ed commented about the May, 2008 Vernor decision (http://weblog.infoworld.com/gripeline/archives/2008/05/you_can_book_a.html) (see my CAD/Court web site (http://www.cadcourt.com/) for more information about the Vernor case). It will be no easy task to fill Ed’s shoes. We can be certain, though, that his work must go on.

Read

The Magic Baseball Bat

· Personal

This is a story about my 11 year old son, Nick, and a father’s pride. I coached Nick’s Little League baseball team this year, and now that the regular season is over I’m coaching an 11-12 year old All Star team. Being the youngest on the team, Nick struggles with his self confidence even though he’s an excellent baseball player. He’s not the tallest player, but he’s faster and more athletic than many of his older teammates. Even so, he doesn’t want to take any risks or make any mistakes, and his insecurities often prevent him from performing at his best. A few weeks ago in the league tournament Nick hit a ball against the fence, just short of going over. That was the closest he came all season to hitting one out, and was perhaps the first time he started to believe that it was possible. A few nights after our team was eliminated from the championship tournament, a kid hit a walk off grand slam with 1 out in the bottom of the 6th, down 9 - 6. Nick and I were there to watch it. I heard that the same kid hit one more out of the park later in the tournament. Those were very likely the only two over-the-fence home runs all year in our local league. Sometime during tournament time, Nick’s baseball bat disappeared from the trunk of my car. I suspect he didn’t close the trunk all the way one night, and someone stole it during the night. The following week, in exchange for Nick agreeing to mow the lawn this summer, I bought him a shiny new baseball bat, a new bat bag, and new cleats to replace the old ones with holes in their toes. Nick was itching to play again so he could try out his new toys. Fast forward to the all star team’s second scrimmage earlier this week. In his first at bat, Nick got walked (then stole second, third, and home over the course of the next few pitches). In his second at bat, Nick hit a hard line drive into the gap, and got to second with a stand-up double. It was just a scrimmage, there was no pressure, and Nick was feeling good about himself, perhaps even daring to feel confident in himself. His third time at the plate, Nick crushed the first pitch well over the center field fence amid groans from the opposing team. There was a mixture of surprise and elation among the other players on our team. Some had never seen a player at this level hit a ball over the fence, and I even had to remind them that they were allowed to enter the field to greet Nick as he crossed home plate. The excitement was soon forgotten as the game moved along, until Nick came up to bat again and everyone jokingly told him to hit another home run. And then, with two strikes, two out, and two on, he did it again! It’s amazing how much difference a shiny new bat can make.

Read