April 25, 2017

ACA/AMEP 2018: New Features Part 2

File Navigation Dialogs
The dialogs for commands that ask for a file to be selected or a folder for a file to be saved, such as the OPEN, ATTACH and SAVEAS commands, will now retain any column sort order you set from one use to the next. Each "type" of file dialog has a separate sort setting. SAVE and SAVEAS will share the same sort, but ATTACH can be different, and must be set separately. The sorting is remembered across sessions of AutoCAD, also.

Drafting Settings Dialog
This dialog is now resizable.

Quick Access Toolbar and the Layer Control
The Layer Control has been added to the list of tools that can be added to the QAT by using the drop-down list at the right end of the toolbar. It is turned off initially, but is there on the drop-down list, waiting for you to select it, if desired.

System Variable Monitor on the Status Bar
The System Variable Monitor tool will appear in the tray at the right end of the Status Bar when a System Variable that is being monitored is changed from its preferred value. In previous versions, you could left click on this tool, and the System Variable Monitor dialog would open, allow you to review the settings and status, and reset all monitored variables to their preferred values. You can still do that in 2018; new is the ability to right click on the tool to get a context menu with three choices:
  • Configure System Variable Monitor: Selecting this is the same as left clicking on the tool.
  • Reset System Variables: Reset all monitored System Variables to their preferred values without opening the dialog.
  • Display Notification: Balloon notification of changes to monitored System Variables is turned on if there is a check mark in front of this item. Select this item from the context menu to remove the check mark, if present, or to add the check mark, if absent.

Off-screen Selection
If you start a selection window when zoomed in, and have to either pan or zoom out/zoom in to another section of the drawing to select the opposite corner, such that your first corner is now off screen, the off-screen objects encompassed by the selection window will now be selected.

Linetype Gap Selection Improvements
The ability to select objects with a non-continuous linetype, or have the gaps in the linework of such objects be recognized by commands like EXTEND has now been extended to both complex and DGN linetypes. Complex linetypes are those that have text or shapes embedded into the linetype. This feature also now works for all object types, including Splines and Polylines with non-zero width.

Share Design View Enhancements
Introduced with the 2017 release (on the A360 ribbon tab, on the Share panel, select the Share Design View tool to start the process for the current drawing, which must be saved), this feature allows you to upload a drawing file to an anonymous location in the Autodesk A360 cloud, and then share views of the drawing with others, who only need to have a supported browser (Chrome, Firefox and other browsers supporting WebGL 2D graphics) to view the file. The actual DWG file is not made available, just the ability to view it. By default, uploaded files expire in 30 days; newly added is the ability to find previous uploads and to extend the expiration date, if desired.

April 22, 2017

ACA/AMEP 2018: New Features Part 1 - External Reference Improvements

I usually start out my first "new features" article for a given release by remarking that I have been busy, and apologizing for the delay in preparing the article. While I am indeed busy this year as well, and that has contributed to the tardiness of this article, another contributing factor is my lack of enthusiasm over the lack of new AutoCAD® Architecture and AutoCAD® MEP features in the 2018 release. My understanding is that you all (meaning, all of you end users out there) have been telling Autodesk that you would rather have them fix things that need fixing in the existing features, rather than adding new features. While I like fixing bugs or adjusting the design of a feature to better suit typical industry workflows as much as the next person (maybe more so), in my mind most of that effort should be in the province of a service pack or hotfix, unless it truly is a major change from the original feature design and the original feature design more or less worked as designed. This is particularly upsetting given that the pain of a new file format is being inflicted, without any offsetting new features that required a new file format to implement.

So, a number of items that had been reported as not working as expected have been fixed. Support for 4k monitors has been integrated for AutoCAD Architecture and AutoCAD MEP dialogs, palettes, etc. (I do not have 4k monitors, so I am taking their word on that.) And, all of the wonderful new things added to the core AutoCAD feature set have been integrated into AutoCAD Architecture/MEP. The balance of this article will look at the improvements made to external references.

External Reference Improvements
  • Relative path is the new default when attaching an externally referenced file to a drawing. Use the REFPATHTYPE System Variable to set a different default path type: 0 = No Path, 1 = Relative Path and 2 = Full Path.
  • Use of a relative path for an externally referenced file no longer requires that the host file be named/saved. Instead, the full path will temporarily be shown in the Saved Path column, with a preceding "*" and, in the Details section, the Pending Relative Path property will show as "Yes". Once the file is saved, any pending relative paths will be resolved and show the relative path in lieu of the temporary full path.
  • If you save a file to a new location and that file has relatively pathed external reference files attached, you will be prompted as to whether or not the relative paths should be updated for the new location. If you only plan to save this one file to the new location and you want the relatively pathed external references to be found, you will most likely want to update the relative paths. If you eventually intend to move (or copy) the relatively referenced files such that they will be in the same relative location, then not updating the paths may be the appropriate choice.
  • There are two new right-click contextual menu choices when dealing with an externally referenced file that is "not found".
    • Select New Path: This option provides the opportunity to browse to a new location (path) for the "not found" file. If there are additional "not found" external references, you will be asked if the new path should be applied to those, as well.
    • Find and Replace: This option allows you to select one or more external references and then specify a target path (Find saved path) and specify a replacement path (Replace with). For ONLY the external references that were selected when you right clicked and chose Find and Replace, AutoCAD will look for any that have the target path and will replace that path with the replacement path.

      If all of the selected external references currently have the same path, that path will be offered as the initial default in the Find saved path edit box. If you select external references with different paths, you will have to supply both the Find and the Replace paths. Note that if you use the ellipsis button at the right side of either edit box, you will get the full path of the selected folder, regardless of the path type shown in the Find edit box, or the path type used for the selected external references. You can manually edit that path to be a relative path, if desired. If the external reference uses a relative path, providing the equivalent full path in the Find box will not result in a match. In limited testing, providing the full path as the Replace path for an external reference that is currently set to relative path did result in the relative equivalent to that full path being applied.

      Find and Replace also appears on the right click context menu when selecting "found" external references and can be used to repath multiple references at one time (provided that the current and replacement paths are the same for all selected external references). Note also that the text entered in both edit boxes has to be an actual path. You cannot just enter the text you want to replace in the Find edit box and the text that you want to substitute in the Replace edit box; the complete path must be used in both (whether a full path or a relative path).

  • When right clicking on one or more selected references and using the Change Path Type context menu item, if all of the selected items currently have the same path type, that path type will be disabled in the cascading contextual submenu. If there are multiple path types in the selected references, then all three options will be enabled.
  • The Open option right click context menu option is no longer disabled for unloaded external references.
  • If you rename an unloaded external reference on the External References palette, it will no longer automatically be reloaded. You will need to reload the reference in a separate action if and when you want it reloaded. Note: As in previous versions, using the RENAME command, and the Rename dialog, to rename an unloaded external reference will leave the external reference unloaded. New in 2018, if you use the Rename dialog or the CLASSICXREF command's Xref Manager to rename an external reference, that change will show immediately in the Reference Manager palette, without the need to reload the renamed reference.
  • There has also been a minor change to the dialog that appears when opening a drawing with external references that cannot be found. Instead of referring to these files as "missing", they are now noted as "Not Found". The text on the button that opens the Reference Manager has also been simplified.

April 11, 2017

ACA: Property Set Definitions, Applies To - Just How Many Polyline Types Are There?

If you ever want to do any scheduling in AutoCAD® Architecture that involves polylines, you will find that there are three different polyline types to which your Property Set Definition can apply. You could select all three, to be safe. Here is an explanation of what each type is, should you want to be more precise (or want to explicitly exclude any of the types).

  1. Polyline: This choice applies to "modern," so-called "light-weight" LWPOLYLINEs. If you have PLINETYPE set to 1 or the default value of 2, then the PLINE command will make this type. (If it is set to 2, and you open an R14-format drawing (or older), any existing polylines will be converted to the the "new" format; if it is set to 1, existing polylines from R14 or older format drawings are not converted.)
  2. Polyline (2D): This choice applies to the old format polylines. You have to set PLINETYPE to 0 to create new polylines in that format. Unless you have a compelling reason to do so, I would not recommend that. The LWPOLYLINE format results in smaller file sizes and faster processing.
  3. Polyline (3D): This choice applies to 3D polylines created with the 3DPOLY command. Polylines created by the PLINE command are "flat" or 2D; all vertices have the same Z-coordinate in the UCS that was current at the time of creation, set by the first point selected. In a 3D polyline, the Z-coordinate of each vertex is independent of those of the other vertices.
If you select a polyline to which the Polyline choice applies, the Properties palette will show it as "Polyline" at the top. If you use the LIST command, it will indicate that it is a "LWPOLYLINE".

If you select a polyline to which the Polyline (2D) choice applies, the Properties palette will show it as "2D Polyline" at the top. If you use the LIST command, it will indicate that it is a "POLYLINE".

If you select a polyline to which the Polyline (3D) choice applies, the Properties palette will show it as "3D Polyline" at the top. If you use the LIST command, it will indicate that it is a "POLYLINE".

Here are the Automatic Properties that are available with each type. Note that the Polyline and Polyline (2D) have the same Automatic Properties; Polyline (3D) has some of the same, but lacks the Closed, Elevation and Thickness properties.

April 10, 2017

ACA as AutoCAD Screencast

Back when AutoCAD® Architecture 2008 was shiny and new, I wrote an article about how to create a desktop shortcut to run AutoCAD Architecture as AutoCAD®, if you did not specify that such a shortcut be created at the time of installation (or deployment creation). Those instructions are still good, but I had the occasion to make a Screencast illustrating the process for AutoCAD Architecture 2015, and I thought I would share that here. In the Screencast, I chose to set the profile name in the shortcut to one that did not previously exist.

April 02, 2017

AutoLISP: Creating a Zero-padded String

In one of the Autodesk Forums, someone had asked for a routine that would put each Polyline in a drawing file on a separate layer. That sounded like a fun challenge, and in the process of putting together a bare-bones solution, I had to decide how these new layers would be named. (I chose to let all of the other layer properties remain at their defaults.). Since I was using a while loop that included an integer-based counter variable to process each Polyline in turn, it seemed simple enough to use that integer value as part of layer name, to make the name unique for each Polyline. Being somewhat retentive, I wanted all the layer names for a given run of the routine to have the same number of characters in them, but there was no way to know up front how many Polylines there would be in any given file.

Once in a file, it is easy enough to determine the total number of polylines, and then to use the itoa AutoLISP function to convert that integer to a string and the strlen function to determine how many characters that largest number would have. To get all of the numeric strings to that same length, I wanted to use "zero padding"; that is, I wanted to add "0" characters to the front of shorter numeric strings to bring the total string length up to that of the largest number. The subroutine I wrote to do this turned out to be elegantly simple (or so I thought), so I decided to post the code here.

(defun ZEROPAD ( ;_ Arguments:
  inum   ; Number to be converted to zero-padded string [integer].
  ichar   ; Number of characters in zero-padded string [integer].
  / ;_ Local variables:
  ilen   ; Number of characters in integer to be converted [integer].
  snum   ; Integer to be converted as a string [string].
        ) ;_ End arguments and local variables.
  (setq snum (itoa inum)  ; String equivalent of integer to be converted.
 ilen (strlen snum)  ; Length of integer string.
  ) ;_ End setq.
  (while (< ilen ichar)   ; While integer string length is less than target length...
    (setq snum (strcat "0" snum) ; ...add "0" to front of string and...
   ilen (1+ ilen)  ; ...increment string length.
    ) ;_ End setq.
  ) ;_ End while.
  snum     ; Return final string.
) ;_ End ZEROPAD.

Somewhat less complicated than the Integer To String - Zero Padding node I created for Dynamo, but the same net result.

March 31, 2017

ACA: Nested XLINEs Unselectable

If you include an XLINE in a Block Definition, when you place an instance of that Block, you will not be able to select the XLINE. This brief Screencast starts out with two XLINEs, a CIRCLE and a square closed POLYLINE. As you can see, the XLINEs can be selected when they are placed directly in the drawing. But after putting all four elements into a Block Definition, you cannot select the resulting BLOCK REFERENCE by left clicking on the nested XLINE or by running a crossing window over the XLINE.



Putting an XLINE in a Block Definition is not something I have ever needed to do, but if you have a use case for it, be aware of this limitation. NOTE: If the Block Definition contains only XLINEs, then you can select the BLOCK REFERENCE by selecting one or more of the nested XLINES. They only become unselectable when there are other object types included in the Block Definition.

February 23, 2017

Autodesk Answer Day - March 8, 2017

The next Autodesk Answer Day will be held on March 8, 2017, and will focus on AEC Products. The English-language event will run from 6:00 am to 6:00 pm US Pacific Time and cover BIM 360, Civil 3D, InfraWorks 360 and Revit. The German-language event will run from 10:00 am to 5:00 pm Central Europe Time and cover AutoCAD Produktfamilie - Deutsch (AutoCAD and Civil 3D) and Revit - Deutsch.

You can find more details in this AutodeskHelp blog article.

February 17, 2017

ACA: Wall Cleanup Tip

Here is an additional Wall Cleanup tip, for a condition that comes up just infrequently enough that I forget to check for this up front. If you have a "base" drawing file (Construct or Element for those of you using Project Navigator and the Drawing Management system) in which the Walls all clean up just fine and also have a "host" drawing file into which that base drawing is externally referenced, in which all (or nearly all) of the Walls from that external reference are showing cleanup errors, the first thing to check is whether or not you have two or more instances of the external reference, all on top of each other. If the Wall Cleanup Group(s) assigned to the Walls in the base drawing allow for cleanup between host and xref drawings (check the Design Rules tab of the Wall Cleanup Group Definition), then the Walls will all be trying to cleanup with the "same" Wall in the other instance(s), generating the cleanup errors. Remove all but one instance of the externally referenced file to eliminate the duplicates and you will likely see your cleanup problems go away.

February 15, 2017

Revit: Cannot Tag Room in a Linked Revit Model

I ran into a case of this today, and as I checked a number of other things that were not the cause of the problem before I found this Autodesk® Knowledge Network article, I thought I would document it here so I can find it faster in the future.

The problem was that the linked model did not have any Rooms in the equivalent phase that was set in the host file Views in which the Room Tags were to be placed. Since Rooms are phase-specific, they need to be recreated for each phase.

In this particular case, there were variations in the names that were given to the phases. To verify how the phases for a particular linked file are mapped (and make any necessary adjustments):
  1. In the host file, select the linked model.
  2. On the Properties palette, select the Edit Type button.
  3. In the Type Properties dialog, under the Other category, select the Edit button to the right of the Phase Mapping parameter.
  4. In the Phases dialog, you can assign the appropriate phase from the linked file to each phase in the host file. Revit will usually match up phases with the same name. (I am not sure what happens if the same names are used, but the phases are in a different order. That is such bad practice that I do not even want to test it.) Selecting in the Phase from linked file column next to a given host Phase will activate a drop-down list, which can be used to select from the phases defined in the linked file.
The phases shown in the image above are just the default Existing and New Construction phases, and are the same in both sample files. On a real project, particularly one with multiple phases, there are "opportunities" for different disciplines to use different names and it may not be readily apparent how the phases map without checking.

January 28, 2017

Seek-ing Content?

If you made use of the Autodesk® Seek, you should know that as of January 16*, 2017, that service has been transferred to BIMobject® Cloud Solution. Links to Autodesk Seek will be redirected to BIMObject. Read more about the transfer in this Autodesk Knowledge Network article. Read more about BIMobject Cloud solution at the BIMobject website.

* - or, perhaps January 18, depending upon whether the date in the AKN article or redirect dialog is correct.

January 18, 2017

AutoLISP: Selecting-Gripping Objects by Handle

The AutoCAD® Architecture SHOWDISPLAYOVERRIDES command is a great way to find objects that have a style- or object-level display override associated with them. At least, in a relatively small file it is. Running the command allows you to select either type of override or both, and it will list the objects at the command line as well as highlight them in the drawing canvas. If your drawing extents are fairly tight, you may be able to start zoomed all of the way out and still see the highlighted objects. But if your drawing extents are larger, then it will be hard to see the highlighting when zoomed out. Unfortunately, the command does not actually select the items, or activate the grips on them. You can use the mouse wheel to zoom in afterwards without losing the highlights, but unless you know where to look, that can be frustrating.

The command line output lists the Display Representation with the override, the override type, the object type and the handle of the object for object-based overrides or the handle of the style for style-based overrides.
Command: SHOWDISPLAYOVERRIDES
Show Display Overrides [byObject/byStyle/Both]: b
Massing Element Display Representation Plan High Detail Object based override found on Mass Element ("460F")
Massing Element Display Representation Plan High Detail Style based override found on Mass Element Style "Standard (2)" ("461C")
Massing Element Display Representation Plan High Detail Object based override found on Mass Element ("4733")
Massing Element Display Representation Plan High Detail Object based override found on Mass Element ("4737")

I wrote a quick AutoLISP® routine that will allow me to type in the handles given for the object-based overrides, that will then select and grip these objects. Provided you do not exceed the maximum number of objects for which AutoCAD will show grips at one time (GRIPOBJLIMIT system variable), you should be able to see where the objects that have been gripped are, even when zoomed out. Please note that you should NOT enter the handle of a Style-based override, as there is no graphical object which can be gripped in that case, and the SSFIRSTSET function will throw an error and crash the routine. A test for that could be added, prior to adding the entity to the selection set, but given the manual nature of entering the handles, I did not think that was necessary here.
(defun C:SELHAND (   ; No arguments.
    / ;_ Local variables:
    ename   ; Entity name of object with entered handle [entity name].
    sHand   ; User entered string of object handle [string].
    ss1   ; Selection set of objects whose handles were entered [selection set].
    ) ;_ End arguments and local variables.
  (setq ss1 (ssadd))   ; Initialize ss1 as an empty selection set.
  ;; Ask user for handle strings, until a null response is received.
  (while (/= "" (setq sHand (getstring "\nEnter handle string: ")))
    (setq ename (handent sHand)) ; Try to get entity name from handle string.
    (if ename    ; If an entity was found...
      (setq ss1 (ssadd ename ss1)) ; ...add entity to selection set.
      (prompt    ; ...else, report failure to find object.
 (strcat
   "\nNo entity with handle -->"
   sHand
   "<-- found. "
 ) ;_ End strcat.
      ) ;_ End prompt.
    ) ;_ End if.
  ) ;_ End while.
  (if (> (sslength ss1) 0)  ; If at least one valid handle was entered...
    (sssetfirst nil ss1)  ; ...select item(s), turning on grips.
    (prompt "\nNo valid handles entered.  Nothing to do! ")
     ; ...else, notify user.
  ) ;_ End if.
  (prin1)
) ;_ End C:SELHAND.

January 09, 2017

AutoLISP: Pickable Command Line Options

AutoLISP® code has long supported the use of keywords with many of the GETxxx functions, to allow the user to specify a command-line option rather than provide the input expected by the particular GETxxx function being used, just like AutoCAD commands. The INITGET function is used, prior to the GETxxx function, to specify the keywords. Several releases back, Autodesk made enhancements to the AutoCAD® command line, one of which allowed for using the mouse to click on a command-line option instead of typing at the keyboard. This was also supported in AutoLISP, and I had used it multiple times.

Over the weekend, I was working on a "quick" personal project in AutoLISP, and I wanted to include pickable keywords. The problem was, I had forgotten the syntax for setting those up, and it took me longer than it should have to both realize the problem I was having was due to improper syntax and to find the correct syntax. To save myself time when that happens the next time (and, I suspect, it will), I am documenting the proper syntax here. I had remembered that the keywords needed to be enclosed in square brackets, but forgotten about separating them with forward slashes. I wrote a quick test function, to verify that the problem was in fact with the GETxxx function message formatting; here is the final, corrected code with the correct syntax:
(defun C:TestKW ( / sKW)
  (initget 1 "Alpha Beta Delta")
  (setq sKW (getkword "\nChose a keyword [Alpha / Beta / Delta]: "))
  (prompt (strcat "\nKeyword selected is -->" sKW "<-- "))
  (prin1)
) ;_ C:TestKW.