AutoCAD 2016 Introduces Smarter Dimensioning Tools 1 Dec, 2015 By: Do you think of dimensioning as a dreary task? With these time-saving new tools, you might start looking forward to it. It's not like any of us CAD users get excited about dimensioning, right? I know I certainly don't! And while dimensioning is a necessary part of documenting our designs, it has been tedious at best in AutoCAD, requiring a myriad of clicks and picks. If you feel the same way, then I have good news for you — AutoCAD is now smart enough to recognize objects and display potential dimensions. Simply move your cursor over an object until the correct dimension displays, then click to acknowledge and place the dimension!
Let's dive deeper into the details of how this works. Set a Default Dimensioning Layer No more forgetting to set your current layer for dimensioning — you can set it once and forget about it! Similar to the Hatch Override tool, you can use the new layer drop-down menu found on the Annotate tab of the ribbon to set a Dim Layer Override ( figure 1). Whenever you use the new Dimension tool, your dimensions will land on this override layer, regardless of your current layer. Use the Dim Layer Override tool to set a default layer for dimensioning. For those of you who prefer to type, there is a new DIMLAYER system variable that you can type in directly. This means you can also set this override in script files and AutoLISP routines.
To make a layer active, use the ActiveLayer property. This property is set on the current drawing. For example: Dim newlayer As AcadLayer Set newlayer = ThisDrawing.Layers.Add('LAYER1') ThisDrawing. About Making a Layer Active (VBA/ActiveX) Products and versions covered. AutoCAD 2015, AutoCAD Architecture 2015, AutoCAD Civil 3D 2015. The polyline.coordinates does not give me any arc information. The Autocad LIST command will give me the arc information but I can't figure out how the get it in VBA. I don't want to have to explode the polyline because then I would need to figure out the order of the separate entities.
If you key in a layer that doesn't exist, DIMLAYER will create that layer for you, using the standard defaults. Note: Dim Layer Override only applies to new dimensions using the new dimensioning tool. If you revert back to old habits and use the legacy dimensioning tools, the dimensions will not land on this default layer! One-Stop Shop for Dimensioning The new (and awesome) Dimension tool ( figure 2) can be found on the Home and Annotate tabs of the ribbon.
You can also access it by simply keying in DIM at the Command prompt. You AutoCAD veterans may remember the DIM command from the early AutoCAD years; well, it's back with a (very productive) vengeance. While in this updated DIM command, you can dimension continually; an extra press of the Enter or Escape key will get you out and back to the Command prompt. The new Dimension tool can be found on the Home and Annotate tabs of the ribbon. With your object snaps off, you can hover over lines, polylines, arcs, circles, etc. And see immediate dimension previews. When the preview displays the dimension you desire, simply pick once to select, and then pick once more to place the dimension line in the desired location, no more questions asked!
Dealing with Errors in AutoCAD Programs 29 Oct, 2015 By: Errors are bound to happen, but it’s simple to incorporate error handling in your VB.NET and VBA code. Regardless of your programming skill level, errors can occur whenever someone runs your program. The key is handling those errors correctly and efficiently. In most of, error handling has been omitted for brevity and clarity in demonstrating other programming concepts. In this article, we’ll look more closely at error handling in two different environments: Visual Basic for Applications (VBA) and Visual Basic.NET (VB.NET). VBA While VBA has declined in popularity among AutoCAD programmers in the past decade, Autodesk still unofficially supports it with a downloadable VBA enabler, so AutoCAD users can continue using legacy VBA routines (see “VBA Lives On with AutoCAD 2016”).
VBA’s simplicity provides a good starting point for understanding basic error-handling concepts. Consider the case where your program needs to perform some basic calculations, such as dividing one number into another to determine a percentage. Errors could occur if the user enters something other than a number (such as a letter), or if the user tries to divide a number by zero.
VBA provides several tools to handle these errors, including the On Error statement. To see how this works, try the following steps. If you haven’t already done so, download and install the (whichever is applicable to your operating system). The enabler works in AutoCAD and its vertical products. Start AutoCAD.
Select the Manage tab on the AutoCAD ribbon, and click Visual Basic Editor. This opens the VBA Interactive Development Environment (IDE), as shown below. From the Insert menu in the VBA IDE, click Module to insert a blank Module. Add the following code into the VBA code window: Private Sub ErrorHandlingExample On Error GoTo ErrorHandler Dim Var1 As Double Dim Var2 As Double Dim Pct As Double Var1 = InputBox('Enter a numerator:') Var2 = InputBox('Enter a denominator:') Pct = Var1 / Var2 MsgBox ('Percentage = ' & Pct) Exit Sub ErrorHandler: Select Case Err.Number Case 11 MsgBox 'You tried to divide by zero.' Case 13 MsgBox 'You did not enter a number.' Case Else MsgBox Err.Description End Select End Sub 6. Click the Play button to run the routine you just created.
Enter a number when prompted for the numerator, and enter 0 when prompted for the denominator. You should see an error message in a message box. Click OK to close the information window and return to the VBA IDE. Click the Play button to run the routine again. Enter a letter when prompted for the numerator.
You should see a different error message. If you enter two numbers when prompted, the program runs as intended and provides an answer. Autodesk VP Explains Software Licensing Policy Changes 9 Sep, 2015 By: CAD Manager Column: To gain more insight into Autodesk's switch to rental-based licensing, we sat down with Vice-President Andrew Anagnost. In the previous edition of the CAD Manager's Newsletter, I provided some planning advice for Autodesk customers who must deal with the company's new policy that will end the sale of perpetual software licenses in favor of rental-based licensing starting in January 2016. Not long after that issue was published, I was contacted by Autodesk's public relations department and was granted an opportunity to interview the Senior Vice-President of Industry, Strategy, and Marketing, Andrew Anagnost. I was given some information about the new licensing policies and was promised I could ask all the questions I wanted, so I jumped at the chance.
Anagnost to be forthright and realistic, and I hope you find the conversation as valuable for your software planning as I have. New Policies on Suite Products Autodesk announced earlier this year that it intended to suspend sales of single-product perpetual licenses (such as AutoCAD or AutoCAD LT) in January 2016, followed by the perpetual license sales of its design-based suites (which are essentially product bundles) in January 2017. The company released a new policy announcement on September 3, however, that brings the timeline forward and will end the sale of perpetual suite licenses on July 31, 2016 — a full six months sooner than previously scheduled. My conversation with Mr. Anagnost started with a brief overview of the policy changes, including a timeline of key milestones and a graphic contrasting Autodesk's views of perpetual vs. Rental licensing models (see below). Robert Green: So the suite-based perpetual licenses will go away sooner than expected?
Andrew Anagnost: This is a big change for how Autodesk does business, and we expect things to be bumpy as the change occurs. That is a big reason why we've elected to move up the cutoff date for perpetual suite licenses — to complete the transition and move forward. RG: Can you clarify what 'bumpy' means? AA: We know this is a new way to license software for many of our customers, so we will have to explain it. We fully understand that it will take a while to prove the concept to our long-time customers. RG: I've heard you refer to the perpetual vs.
Rental software question as 'a tale of two customers.' AA: Yes, that is how we see it. Our most loyal long-term customers are our maintenance customers, while our new customers are fine with using rental licenses to meet their needs. In fact, they actually prefer it because they can buy into the software at a lower upfront cost and then bill those costs to their customers as a project expense. RG: There is some uncertainty about whether 'perpetual' really means perpetual. On the Autodesk web site, it says perpetual licenses can be kept on maintenance 'for the foreseeable future,' yet the press release says 'in perpetuity.' Can you clarify?
AA: We have no plans to discontinue maintenance subscription plans for existing perpetual license owners. RG: But you can see how there could be confusion given the difference in wording, right? AA: I assure you we have no plan to discontinue maintenance subscription plans for existing perpetual license owners. Customer Experience Another major topic of conversation had to do with customer acceptance and what Autodesk terms the 'customer experience' of a rental software mode of operation. This part of the discussion touched on many themes that are summarized in the comparative graphic below.
I asked a few clarifying questions generated by the graphic as a follow-up. Perpetual vs. Subscription (rental) comparison matrix. Image courtesy of Autodesk.
Here’s a little tip that might be obvious to some, if not most of you. But for anyone that doesn’t know this, it can be useful to know. When using the trim command, you tend to specify geometry to trim lines back to. Of course this is no different with polylines, and you can of course use polylines to trim other geometry back to. But you may not know that you can actually trim a polyline back to itself, even when it doesn’t intersect itself. For example, you may have a polyline that looks like below: Lets say you want to trim away the whole horizontal portion of the polyline. A lot of people would invoke the TRIM command, hit spacebar or enter to select trimming back to everything, and trim away the individual parts of the polyline (the coloured parts below): Ok, I admit that this gets the job done.
But on a more complex polyline, with more information in the drawing this will take longer. AutoCAD® has to compare the point you picked with all other objects in the drawing to detect places to trim back to. In severe cases where the drawing is very busy, you could be faced with a crash situation, as the computer calculates all the possible lines you might want to trim back to. For this reason, I think it is best to always tell AutoCAD® exactly what you want to do.
Doing so minimises the complexity of the task, thus minimising the chance of AutoCAD® crashing or hanging. So in this case, what I would do is invoke the TRIM command, select the polyline, and then pick the horizontal section. This is the most clear instruction to AutoCAD®. AutoCAD® knows to ignore any geometry other than that selected, which makes it very easy to know what you want to achieve. AutoCAD® will trim back to the next found vertices of the polyline: So there we go – not exactly the most revolutionary tip in the world, but it could save you some time and gives a clearer instruction to AutoCAD®, thereby reducing the calculation overhead and crash chance. That’s all for today.
![Polyline Polyline](/uploads/1/2/5/3/125391867/497256877.jpg)
As always, I’d like to remind any new readers to subscribe below – its just an email, whenever I’ve written a new article.