July 30, 2017

Ribbon Tools in AutoCAD 2018.1 Update

The ".1" update for AutoCAD® 2018 for subscription and maintenance customers was released on July 27, 2017. You can see what's new in AutoCAD 2018.1 by reading the AutoCAD 2018.1 and AutoCAD LT 2018.1 Update Preview Guide. According to the Readme, the AutoCAD 2018.1 Update can be installed on AutoCAD-based verticals, such as AutoCAD® Architecture 2018 and AutoCAD® MEP 2018.

PLEASE NOTE: The update will overwrite the ACAD.cuix file for your 2018 product. If you have made any customizations to the ACAD.cuix file, be certain to back that file up prior to installing the update.
08/03/2017 UPDATE:  I have been told that the ACAD.cuix file does not get overwritten if you have already run the program at least once, but that the file is updated and the new panel and tool are added.  I would still back the file up prior to running the update if you have any customizations. The ACA.cuix or MEP.cuix file will not be updated.

While compatible with the vertical applications, the update will not update the customization files for those verticals that do not use the ACAD.cuix file as the main customization file, such as ACA.cuix and MEP.cuix. I personally have no problem with that, as I would rather maintain the Workspace customizations I have done in my main CUIX file* and manually transfer any new items I deem worthy. Here is how to get the Named Views panel and Insert View tool added in the AutoCAD 2018.1 update into your vertical's customization file. I will be working with the ACA.cuix file, but the same process applies to the MEP.cuix file, or that of any other AutoCAD-based vertical that does not use the ACAD.cuix file.

The first step is to install the AutoCAD 2018.1 update, which you can download from your Autodesk® Account page.

With the updated ACAD.cuix file for 2018 in place, you can now use the Transfer tab of the Customize User Interface dialog to copy the panel and the tool to your customization file. The following Screencast shows how to do so.
  1. After installing the AutoCAD 2018.1 Update, launch your vertical product.
  2. Start the CUI command to open the Customize User Interface dialog. Select the Transfer tab.
  3. The left pane of the transfer tab may already have your current main customization file open. If not, open it on this side.
  4. On the right pane, use the open tool and navigate to the location of the ACAD.cuix file in your user profile. Mine was located at
    C:\Users\dkoch\AppData\Roaming\Autodesk\ACA 2018\enu\Support
    Substitute your user name for "dkoch". Depending upon where you are in the world and what language version you have installed, the "enu" folder may have a different name. If you have your roaming Windows profile files on your network, then look there for the AutoCAD Vertical Product 2018 Support folder. Also keep in mind that the AppData folder is a hidden folder in Windows, so you will have to turn on the display of hidden files and folders if you plan to use the Search feature or navigate to the folder.
  5. On both the left and right panes, expand the Ribbon node and then the Panels node below that. Scroll down to find the Layout - Viewports panel in each customization file. Expand that panel's node and then expand the Row 1 node below that.
  6. On the right pane (ACAD.cuix), select both the Separator after Sub-Panel 1 and the Sub-Panel 2 node. The Sub-Panel 2 Node contains the Insert View tool.
  7. Hover the mouse over one of the highlighted items, press and hold the left mouse button down and drag those two items over to the left pane. Position the cursor just below the Sub-Panel 1 node. When you see the blue bar, release the left mouse button to drop those two items into the ACA.cuix version of the Layout - Viewports panel.
  8. If the Separator comes in below the Sub-Panel 2 node in the left pane, drag it up so that it is in between the Sub-Panel 1 and Sub-Panel 2 nodes.
  9. In the right pane (ACAD.cuix), scroll to find the View - Named Views panel.
  10. Drag the View - Named Views panel from the right pane to the left pane, under one of the nodes under the Panels node and drop it, to copy it to the ACA.cuix.
  11. Select the Customize tab in the Customize User Interface dialog.
  12. In the upper left pane, under the ACA node (or the node for the main customization file for your vertical product), expand the Ribbon node, and then expand the Tabs node under that.
  13. Scroll down to find the View - ACA ribbon tab, and expand that node. You will see a listing of the panels currently assigned to that tab.
  14. Scroll down and expand the Panels node under your main customization file. Scroll down to find the View - Named Views panel that you just copied.
  15. Drag the View - Named Views panel up toward the top of the list box in the upper left pane. The list box should start scrolling when you get close to the top. Keep scrolling until the View - ACA ribbon tab is visible.
  16. Drop the View - Named Views panel into the list of panels under the View - ACA node. I find that it is difficult to drop an item at the very end of a list of things under a node, so I usually drop it just above the current last item, and then drag that item above the item I just dropped, if I want the added item to be the last in the list.
  17. Select the OK button to ratify your changes and dismiss the Customize User Interface dialog.
  18. If a layout is not already set current, select a layout. The Layout contextual ribbon tab should appear. Select it and verify that the Separator and the Insert View tool were added to the Layout Viewports panel.
  19. Select the View ribbon tab and verify that the Named Views panel was added.

* - To make moving to a new release easier, I try to limit customization of the ACA.cuix file to those things that have to be there, such as Workspaces, and put as much as I can into a separate customization file, loaded as a partial customization file. That keeps my "stuff" mostly separate and I can adopt the ACA.cuix file that ships with the new release.

July 23, 2017

In What Version of AutoCAD Was My File Saved - Update 1

After using the FMT command over the last month or so (see this previous post), I became annoyed by the fact that, when trying to check multiple files in the same folder, I had to navigate to that folder from "My Documents" each time. The AutoLISP getfiled function can be told to start in a specific folder; my original code was written quickly and was initially more of a proof-of-concept effort. Actual use exposed the problem with using the default starting folder. So I made a few modifications to the code, including establishing a global variable (one that does not lose its value after a run of the program), sFmtPath, to hold the directory path of the file selected on the previous use of FMT.

I added an if statement at the very beginning of the code to test to see if the value of sFmtPath is either nil or is not a string. If either of those conditions is true, the value is reset to an empty string [""]. If neither is true, the string value is left as is. This string value is then passed as the second argument to the getfiled function. If you check the old code, you will see that this was hard-coded as an empty string, so on first use in a drawing editing session (or if the value was somehow changed to a non-string value), the program will run just the way the old one did, starting in the My Documents folder. But after that first run, supplying the folder path there and setting the flags argument (last argument) to 16 (setting the 4 bit) has the getfiled function use that folder as the initial starting folder, making it easier to check multiple files in the same folder, or a folder that is close by in the folder structure.

I suppose the initial test should, if sFmtPath does contain a string, also then check to see if that string represents a folder on the current machine, but, for now, I decided that would be overkill. Unless you intentionally mess with the value of sFmtPath or if you have another program that also sets a value of a global variable that is also named sFmtPath, there should not be any issues.

Here is the revised AutoLISP code.
(defun C:FMT ( / file1 sfile1 sline1 stext1)
  (if (or
        (not sFmtPath)
        (/= 'STR (type sFmtPath))
      ) ;_ End or.
    (setq sFmtPath "")
  ) ;_ End if.
  (setq sfile1 (getfiled "Select Drawing File" sFmtPath "dwg" 16)
        file1  (open sfile1 "r")
  ) ;_ End setq.
  (if file1
    (progn
      (setq sline1 (read-line file1)
            stext1 (substr sline1 1 6)
            sFmtPath (vl-filename-directory sfile1)
      ) ;_ End setq.
      (close file1)
      (cond    ; Condition A.
        ((= "AC1032" stext1)
         (alert
           (strcat
             "Header = AC1032."
             "\nFile " sfile1
             "\nis saved in the 2018 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A1.
        ((= "AC1027" stext1)
         (alert
           (strcat
             "Header = AC1027."
             "\nFile " sfile1
             "\nis saved in the 2013 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A2.
        ((= "AC1024" stext1)
         (alert
           (strcat
             "Header = AC1024."
             "\nFile " sfile1
             "\nis saved in the 2010 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A3.
        ((= "AC1021" stext1)
         (alert
           (strcat
             "Header = AC1021."
             "\nFile " sfile1
             "\nis saved in the 2007 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A4.
        ((= "AC1018" stext1)
         (alert
           (strcat
             "Header = AC1018."
             "\nFile " sfile1
             "\nis saved in the 2004 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A5.
        ((= "AC1015" stext1)
         (alert
           (strcat
             "Header = AC1015."
             "\nFile " sfile1
             "\nis saved in the 2000 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A6.
        ((= "AC1014" stext1)
         (alert
           (strcat
             "Header = AC1014."
             "\nFile " sfile1
             "\nis saved in the R14 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A7.
        ((= "AC1012" stext1)
         (alert
           (strcat
             "Header = AC1012."
             "\nFile " sfile1
             "\nis saved in the R13 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A8.
        ((= "AC1009" stext1)
         (alert
           (strcat
             "Header = AC1009."
             "\nFile " sfile1
             "\nis saved in the R11/R12 file
            ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A9.
        ((= "AC1006" stext1)
         (alert
           (strcat
             "Header = AC1006."
             "\nFile " sfile1
             "\nis saved in the R10 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A10.
        ((= "AC1004" stext1)
         (alert
           (strcat
             "Header = AC1004."
             "\nFile " sfile1
             "\nis saved in the R9 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A11.
        ((= "AC1003" stext1)
         (alert
           (strcat
             "Header = AC1003."
             "\nFile " sfile1
             "\nis saved in the Version 2.60 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A12.
        ((= "AC1002" stext1)
         (alert
           (strcat
             "Header = AC1002."
             "\nFile " sfile1
             "\nis saved in the Version 2.50 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A13.
        ((= "AC1001" stext1)
         (alert
           (strcat
             "Header = AC1001."
             "\nFile " sfile1
             "\nis saved in the Version 2.22 file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A14.
        (T
         (alert
           (strcat
             "Header = "
             stext1
             "\nFile " sfile1
             "\nis saved in an unknown file format."
           ) ;_ End strcat.
         ) ;_ End alert.
        ) ;_ End condition A15.
      ) ;_ End condition A.
    ) ;_ End progn.
    (prompt "\nNo file selected. ")
  ) ;_ End if.
  (prin1)
) ;_ End C:FMT

July 10, 2017

Autodesk Answer Day - APAC


The next Autodesk® Answer Day, for Asia-Pacific customers, will be held on Thursday, July 13, 2017. The event will be held in English and Chinese, and will cover AutoCAD®, AutoCAD® Mechanical, Inventor®, and Revit®. The events will be held in the respective product forums; refer to this Autodesk Community Announcement page for details on the times and links to the forums.