Can I take your order?

Well, not if my command line disappeared. A quick tip... CTRL + 9 puts you back in command. (I found this out the hard way if you are wondering).


Names have changed to protect the innocent

Recently a user here had all of his standard parts in the drawing change to anonymous block names when he reopened the drawing. While working with the drawing, all was fine but when he closed and reopened, the parts (eg screws, washers, etc...) would change to names like *U138. Hmmm, after a little checking I found he was saving down to AutoCAD 2000 from Mechanical 2006 (2004 format). This destroys the standard part (proxy part) into a block. Anyway, I just reset his save version in the options and he is back in business. Another day another er.. aa.. another day.


My blocks locked me outside and I forgot my key!

A feature that AutoCAD now has is the ability to lock blocks from editing. A seemingly nice feature but what if you really really need to edit the block. Well, they hid the key under the mat. Where is the mat you ask. Why of course, it is in the same place you open the door. The BLOCK command. To unlock your "door", select the block command and select the block you are interested in, now look at the dialog and notice the CheckBox to "Allow Exploding", what are you waiting for, check it. Now the door is open. AutoCAD will make sure you want to unlock the door by having you confirm the operation. Come on in and make yourself at home.


How to set the standard

In AutoCAD Mechanical, standards are the... well standards by which other things are measured. We base everything off the ISO standard so that we are all on the same "page" so to speak. Most of our customers live by this standard, so it becomes even more important to adhere to their "gold standard" (hint hint ... final payment). Anyway, we generally use a template to start drawings with our standard in place. We have had times where a rogue user or an outside drawing made its way into the mix, so I came up with a little macro to "set the standard". After setting a reference to the SymBBAuto library, use the following to get the standard you always wanted.

Private Sub SetMeStdToIso()
On Error Resume Next
Dim mcadSymBb As McadSymbolBBMgr
Dim mcadStdMgr As McadStandardMgr
Dim mcadStd As McadStandard
Set mcadSymBb = ThisDrawing.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
Set mcadStdMgr = mcadSymBb.StandardMgr

mcadStdMgr.CurrentStandardName = "ISO"
If mcadStdMgr.StandardCount > 1 Then
For Each mcadStd In mcadStdMgr.Standards
If mcadStd.name <> "ISO" Then 'Or mcadStd.Name <> "DIN" Then
End If
Next mcadStd
End If
End Sub


Now for my next trick...

How to make the invisible disappear. Why bother you say. What I found out recently is, what I can't see can hurt me. We convert our files to our customers formats once we have completed their jobs. We convert our layer/linetype structure to their layer/linetype structure. I have created macros to do that for us and they work pretty well. Recently these macros would take an inordinate amount of time to work or even crashing AutoCAD after processing a single drawing for an hour or so. What's happening? The macro would purge the drawings and process all blocks to redefine their "innards". I would see blocks flash on that were not in the drawing. Hmmmm... I thought about it. They are either referenced by something in the drawing and can't be purged or.... they were invisible. AutoCAD now has the power to make things invisible (if you did not know). So, I pulled up a trusty macro I built from some other posts and then like magic, the drawing went from 22 mb to 5 mb and converting layers took 10 seconds. Wow. I am posting this gem in case you need some "magic" also.

Public Sub DeleteInvisibleEnts()
'DeleteInvisibleEnts: Makes all objects in an AutoCAD drawing visible.
Dim acSs As AcadSelectionSet
Dim dPt1(0 To 2) As Double
Dim dPt2(0 To 2) As Double
Dim acObj As AcadObject
Dim acLyr As AcadLayer
Dim acLyrs As AcadLayers
Dim sCurrLyr As String
Dim iCode(0) As Integer
Dim vVal(0) As Variant

Set acLyrs = ThisDrawing.Layers
iCode(0) = 60 'visibilty pair
vVal(0) = 1 '1=invisible, 0=visible

Set acSs = ThisDrawing.SelectionSets.Add("INVIS")
acSs.Select acSelectionSetAll, dPt1, dPt2, iCode, vVal 'ALL OBJECTS
'Cycle through all objects
For Each acObj In acSs
If acObj.Visible = False Then
sCurrLyr = acObj.layer
Set acLyr = acLyrs.Item(sCurrLyr)
'Check for locked layer, and unlock it if it is
If acLyr.Lock Then
acLyr.Lock = False 'Unlock the Layer.
acObj.Visible = True 'Display the invisible item
acLyr.Lock = True 'Re-lock the Layer.
acObj.Visible = True
End If
End If
Next acObj
'If you stop here, all invisible items are now visible
Call DeleteAllObjsFromSelSet(acSs) 'A macro to cycle thru and delete the items
If Not acSs Is Nothing Then
End If

End Sub


Shooting star.. uhmmm symbol I mean

Geometric tolerances with their own mind... stop it! When he would add a geometric tolerance symbol and then would try to place it (while ortho was on), it would shoot to a distant location away from his desired spot. The solution. I noticed his UCS icon was not set to world (a small square around the origin). When we set it back to world. Tada! We were back in business. I wish they were all so easy.


Are you structured?

To structure or not to structure, that is the question. Structure is an interesting concept in Mechanical and does have some great advantages. I am not here to argue about it, but I am commenting on how to get around it. When we began with AutoCAD Mechanical 2006 from AutoCAD Mechanical 6 (2002), we found that our drawings now had structure. Structure might seem like a good thing, but we do not work that way and we did not want to rethink our antiquated ways. With structure enabled, we could no longer use our Hide/Restore dialog from previous releases. Our design process (for better or worse) relied on blocks, their naming, and the ability to block edit them. Help! Now, Associative Hide worked but not the way we worked previously with Hide/Restore. The answer, go back in time. Or in layman's terms SAVEAS. Save to a previous version and when you close and then reopen the drawing, make sure Structure is turned off in the ASSIST>>OPTIONS>>STRUCTURE tab of the menu.


This looks like the beginning of a beautiful friendship

I have decided to start this blog to post my successes and failures with using AutoCAD Mechanical. I find help to be somewhat scarce for this software and I wanted to create a place for others to meet and see what is going on with it.
Well, page 1.
AutoCAD Mechanical 2006 and the CUI. In a word, "I hate it" (oops ... well three words). I guess I can see where Autodesk is headed with this but I find myself like my kids, "Are we there yet"? Maybe I am just set in my old ways but I feel like the waters are so murky here that I am afraid what I am going to step on. I have found that the the best way for me to bring in my old menus and toolbars is to use the base interface and then MENULOAD my custom ones. I retain my icons (buried in a dll I created) and the push-pull process of turning things off and on is easier.
A interesting thing I found out and I have seen posted elsewhere is that the Enterprise Customization CUI is turned on when you add it in the ASSIST>>OPTIONS section. A caveat or note is that you cannot edit it when it is current though. You can edit the Main Customization file and then you can swap the MAIN and ENTERPRISE in the OPTIONS. From that point, you can change the Enterprise one. Once you are finished, swap the two back in the OPTIONS and you can go on with your life again.
Last thing of note is that by default, AutoCAD retains the last button selected on a flyout toolbar. Mechanical does the opposite and that annoys me a little. I remember the days when you could pick which ones did an which ones did not. The CUI has no editable fields I can see (I know, I know, don't touch this file unless you want to give up your left big toe) and the forums at Autodesk are no help.
Enough ranting for today. Get back to work.