December 17, 2013

Revit Phasing and Demolition: Required Reading

The need for a demolition phase has been a topic of discussion in my office. I do not see the need, in general, and feel that it creates more work to show essentially the same thing. Steve Stafford says it better than I can, so if you are dealing with this issue as well, you may want to read his article on the subject. There is additional discussion in the comments on that article, so be sure to read those, as well.

December 14, 2013

ACA: File Select Dialogs Open Slowly

I had been noticing that the file dialogs in AutoCAD® Architecture 2010 were opening somewhat slowly over the last several months and became exceptionally slow this past Wednesday. I was not experiencing that issue in ACA 2014. I suspected that somewhere in my Options I had a bad file/folder reference or a folder that had a broken Windows shortcut in it. Things were so bad that after I completed the task at hand, I took the time to check out each reference, but did not find any problems. I was about to give up, when the problem planted itself right in front of me and amazingly enough I recognized it.

I make extensive use of the fact that AutoCAD allows you to save the current folder in the "shortcut bar" at the left side of most "Select File" dialogs, such as the one that appears when you issue the OPEN command. Unfortunately, I am not always diligent about removing older ones. I have been short on hard drive space on my computer for the last year or so, and have occasionally made DVDs of my personal project folders for older projects and then removed them from my hard drive. This turned any shortcuts to these project folders in AutoCAD into broken links, and waiting for these to time out was what had been causing the delay in opening the "Select File" dialogs. What made the performance on Wednesday exceptionally bad was that the server on which projects started in 2011 were stored went down today, and I had a number of shortcuts to folders on that server. Fortunately, AutoCAD/Windows gives you a clue that the link has become broken, by changing the folder icon from the manila, "3D" folder to a flat, white folder. Thanks to the server issue, I had so many of these white folders that I could not help but notice them. Once I removed all of them, the Select File dialog opening time returned to normal.

December 12, 2013

ACA: Formula Property to Determine if a Block Instance is a Dynamic Block

You can use the following code in an AutoCAD® Architecture Formula Property in a Property Set that applies to Block References to determine if the Block Reference is a Dynamic Block.
set acadApp = GetObject(,"AutoCAD.Application")
set obj = acadApp.ActiveDocument.ObjectIDToObject( [ObjectID] )
RESULT = obj.IsDynamicBlock

As in the previous example, [ObjectID] is a properly created property reference to an automatic property in the same Property Set, named ObjectID, which references the Object ID automatic property source. This formula will return a value of TRUE if the block reference is a Dynamic Block and FALSE if the block is a "regular" block. The property can be used as the condition for an IF Statement, if you need another Formula property to take different actions based on whether or not the block reference is a dynamic block.

December 10, 2013

ACA: Obtaining the Effective Name of a Dynamic Block in a Formula Property

While Dynamic Blocks and ACA do not always play nicely, there are some who want to take advantage of both Dynamic Blocks and the AutoCAD® Architecture Schedule feature. One challenge is that the Name automatic property source may return an anonymous block name rather than the Dynamic Block name; for example, when a Dynamic Block with a stretch action is stretched. Fortunately, you can obtain the orignal block name from the EffectiveName property of the Dynamic Block instance, in a Formula property, using the the following VBScript code:
set acadApp = GetObject(,"AutoCAD.Application")
set obj = acadApp.ActiveDocument.ObjectIDToObject( [ObjectID] )
RESULT = obj.EffectiveName

The Property Set Definition that includes the Formula property will also need to have a property that references the Object ID automatic property source. In the example code above, this property has the default ObjectID name, and the [ObjectID] text in the formula represents a properly created property reference, created by double-clicking the property name in the Insert Property Definitions box in the lower left of the Formula Property Definition dialog.

December 03, 2013

Revit: Hosting Face-Based Light Fixtures to Ceilings in Linked Files

We ran into an issue at the office today, and I wanted to document the solution for my own future reference. Our firm has architects and engineers in-house, and each discipline typically works in separate models that are then linked into each other. This particular project was being done in the 2012 versions of Revit MEP, Revit Structure and Revit Architecture. The electrical engineers found that they were not able to place face-based light fixture families in their model, and host them to the ceilings that were modeled in the linked architectural model. Reflected ceiling plan views were being used and the ceilings were visible, but the fixtures would only host to the Walls.

It turned out that the Ceiling model category was turned off in the affected views in the Electrical model. This did not prevent the linked architectural model from displaying the ceilings, and they were also TAB-selectable in the Electrical model. But it did prevent Revit MEP from "seeing" them as a potential host. Once the ceiling category in the electrical model was turned back on in those views, Revit was able to find the ceilings and host fixtures to them. It was necessary to check the Show categories from all disciplines toggle in order to do this.

November 30, 2013

ACA: Offset External References, Location Properties and Schedule Tags

If you have ever externally referenced several files into one host file, and had Schedule Tags placed within the externally referenced files that displayed property values that were from or based on Location properties, you may have found that in the host file, the Schedule Tags did not display the expected values. One common example would be the use of a Door Tag that displays an ID value for the Door that is based in part on the associated room number, with the room number value being brought into the Door's properties via a Location property.

Depending upon what version you are using and how you place the external references, you may find that the values displayed in the tags all display values from the Spaces of one of the external references, or that you get *Space not found* in lieu of the Space-based property value that the Location property is supposed to be reading and which shows as expected when the externally referenced file is opened directly.

Things worked as expected in ACA 2009 and earlier, but some change made in the 2010 release affected the way that Location-property-dependent values are displayed in tags nested (placed) in the files that are externally referenced. All of the examples shown in this article are done outside of the Drawing Management feature (Project Browser and Project Navigator). Because managing property data overrides is difficult outside of the Drawing Management feature, tags referencing object-based properties are usually placed directly in the file that holds the object being tagged. (My firm does it this way, and from recent posts in the Discussion Groups, it appears that others do as well.) Note also that a Schedule Table placed in the host file that is set to scan external references and which uses the external references for the selection set and applies to the same objects that are tagged by the nested Schedule Tags will display the expected values in all of the releases from 2010 through 2014; the issue is only with the values displayed by nested Schedule Tags. In all releases since 2010, it appears that nested Schedule Tags do not look for a Space from the effective location of the nested Location grip in the host file, but instead take the relative X- and Y-distances from the insertion point of the external reference to the Location grip, and then apply that X, Y coordinate relative to 0,0 in the host file and look there for a Space (or, if your Location references a property attached to an AEC Polygon, for an AEC Polygon). If it finds a Space, it reads the specified property from that Space. That works fine for one external reference, inserted at 0,0. But in a file where you are inserting several external references, you will likely not place all of the files at 0,0,0, since then it would be up to ACA to determine which of what would likely be several overlapping Spaces would be used. Assuming that each floor of the floors is above or below the others (and that they share a common 0,0 point), all of the floors would be reading values from the Spaces in the floor placed at 0,0,0.

The logical solution would be to not place any of the external references in the host file at 0,0,0 and to place then such that the building footprint relative to 0,0,0 is left open in the host file. Unfortunately, in the 2010 and 2011 releases, that results in the tags displaying *Space not found* in lieu of the expected Space-based property value. I apologize to anyone still using the 2012 release, as I do not have access to an installed version of that release, so I am not certain how that release behaves. In the 2013 and 2014 releases, a partial adjustment was made, and the tags will display the value they display directly in the external reference file, provided that there is no Space at the "mapped" location relative to 0,0 in the host file.

I have posted some sample files, in the Door tag incorrectl​y finding informatio​n from other floors thread in the Autodesk AutoCAD® Architecture General Discussion Group, based on the "Room" shown in the image above, so that you can see the effects firsthand. There are three "floor" files, for the First, Second and Third floors, and a "sheet" file into which the three floor files are externally referenced. Each floor file has a single Space onto which two doors open. The files include a modified version of out-of-the-box DoorObjects Property Set Definition, in which two new properties have been added: RoomNumberNonProjectBased is a Location property, referencing the SpaceObjects:Number property attached to the Space; NumberRoomBased is a Formula property that concatenates the RoomNumberNonProjectBased property, a period (".") and the NumberSuffix property. The left-side doors have a NumberSuffix value of "1"; the right-side doors have a value of "2". The sheet file has a modified version of the out-of-the-box Door Schedule, with the MARK column deleted and replaced by a DOOR ID column, displaying the value of the NumberRoomBased property. The Doors are tagged in each floor file with a custom Schedule Tag that also references the NumberRoomBased property. The files were created in ACA 2010, so that they can be opened in that release or any later release.

The image below is of the sheet file, opened in 2010. None of the externally referenced floor files is inserted at 0,0, and there are no Spaces below the "mapped" location of the Location grips of the Doors.
Notice that the DOOR ID column in the schedule table correctly shows the values on all three floors, yet, as shown in the enlargement of the Second Floor external reference, the Schedule Tags inside the plan external references, which tag the doors, show *SPACE NOT FOUND* instead of the room number.

If the First Floor external reference is moved so that its insertion point is at 0,0,0 and the model is regenerated, then the nested Schedule Tags on the Doors on all three external references read the room number from the First Floor external reference. The Schedule Table continues to show the correct values, as seen in the image below.

If the First Floor external reference is moved back to its previous location, away from 0,0,0, and two Spaces (ROOM 5555 and ROOM 6666) are drawn in the host file, one at each mapped location and the model is regenerated, then the nested Schedule Tags on the Doors on all three external references will read the corresponding room numbers (5555 and 6666), but the Schedule Table will show the correct values, as shown in the image below.

Opening the same files in 2013 or 2014 will give the same results, with the exception of the first sheet view image above, where instead of *SPACE NOT FOUND*, the desired room numbers will be displayed on all three floor plans, because there is no Space in the "mapped" location.

November 27, 2013

November 18, 2013

Help! If only....

This is just a quick vent post on my increasing frustration with the Help that is currently available in AutoCAD® Architecture. I appreciate that moving the online Help "online" (internet-based) allows them to update the content, and that the vehicle for doing so would not necessarily be the same as it was back in the 2010 release, when the "online Help" files were locally installed. But it seems with each release, they take away another feature and make it that much harder to actually use the Help.

My personal peeve is the removal of the Contents tab. The old search function may not have always gotten me to the page I wanted, but more often than not it got me close, and I could then pop over to the Contents tab and look in the general vicinity of the "close" page and usually find what I needed. In its current incarnation, the Help is all but totally dependent upon the Search feature, as the only other options are a few general links on the home page (thank goodness they put a link to the system variables back on that page) and the Favorites, where you can save a page once you finally find it. If the new search was all that and then some, perhaps I would not be so frustrated. Here is an example of why I am frustrated:

I was trying to get up to speed on object transparency, and I had become aware that when plotting, transparency is turned off, by default, for performance reasons. I could see the toggle to enable transparency in the plot dialog, but I wanted to know more about it, and whether there was a System Variable that could also control that setting. So I did a search for PLOT TRANSPARENCY filtered for User information, and the second hit was the Plot Dialog Box article in the Help, which I selected and scrolled down to the section on Plot Options, which had the description of the Plot Transparency toggle.
As I suspected, there was a System Variable, and I wanted to know more about it. Unfortunately, the PLOTTRANSPARENCYOVERRIDE text in the Help was not a hyperlink. "No problem," I thought, "my current search is for PLOT TRANSPARENCY, surely PLOTTRANSPARENCYOVERRIDE must be in the search results." So I scrolled down the first page of results and did not find it. I went to the second and third pages and came up empty there, too. (For the record, it was there, the twentieth item on page five. I typed two thirds of the title of that article as my search criteria. How could it possibly be the 120th result?)

After scrolling through the third page, I grew weary and decided to take advantage of the fact that I already knew the name of the System Variable. Perhaps the problem was that I had typed a space between "PLOT" and "TRANSPARENCY". I removed that space and redid the search, only to find that PLOTTRANSPARENCY generated no results.
The Help did kindly offer an alternate search term, which I gamely tried (even though it introduced extraneous text). I was very disappointed to find that there were no search results for plottransparenz, either. Why offer an alternate search term if there are no results for it?

Finally, I did what I apparently should have done before even looking through the current search results, and changed the search string to PLOTTRANSPARENCYOVERRIDE. Searching on the entire name resulted in a much-reduced list of hits and put the one I wanted right at the top. All well and fine, since I already knew the name of the System Variable, but what about times when I half-remember part of the name? Why is the search limited to whole words?

After the fact, I did discover one somewhat hidden gem in the current Help. If you select the tool with the funnel icon to the right of the user type drop down, you have the opportunity to filter the search results to just Commands, just System Variables or just Commands and System Variables. Had I done this on my original search terms of PLOT TRANSPARENCY, the article I wanted would have been the first search result and I would have been somewhat less frustrated. The filter does not resolve the issue where partial System Variable or Command names do not generate any results (unless that part exists as a free-standing "word" somewhere in the text). But it will save me from having to scroll through five pages of results to find something that should have been on page one from the start.

Note that unchecking the "Include Autodesk Web Results" toggle only removed four items from my original search, and the PLOTTRANSPARENCYOVERRIDE page was still on the fifth search results page, moving all the way up to number 118.

October 19, 2013

ACA: AEC Content on the Ribbon

In December of 2009, I contributed an article to AU Tech Talk, about adding tools for AEC Content to the ribbon in AutoCAD® Architecture. That article no longer appears to be available on the Autodesk website, so I am reposting it here:

The out-of-the-box AutoCAD Architecture ribbon tabs include a number of tools that allow you to add AEC content such as elevation and section marks, keynotes, leaders, display themes, schedule tags and schedule tables. Rather than duplicate the abilities of tool palette tools to import styles or definitions from a source file when necessary and to preset property values, these ribbon tools “run” a tool palette tool, through the AECRIBBONTOOL command.

To create a ribbon tool for your own custom content, you will need a tool palette tool for the content and an editable customization file in which you can add a ribbon tool.

Tool Palette Tool
Any tool palette tool that exists in the current workspace can be referenced from a ribbon tool, whether or not the palette on which the tool resides is included in the current tool palette group. If the ribbon tool is to be shared with others, everyone will need to have the referenced tool and you will not want the tool or the palette on which it resides to be easily deleted or edited. The out-of-the-box setup achieves this by having the ribbon tools reference tools that are on a read-only palette that is not part of any of the out-of-the-box tool palette groups. To see this palette, you need to set “All Palettes” current. Depending on what profile is set current, this palette may be called Ribbon Tools – AutoCAD Architecture (US Imperial), Ribbon Tools – AutoCAD Architecture (US Metric), Ribbon Tools – AutoCAD Architecture (UK) or a palette associated with the localized content your are using. You may want to set up a similar read-only palette for the tools that will be referenced by your ribbon tools, if you do not have a read-only, network-based tool palette location that everyone has in their workspace.
Figure 1 – Custom Ribbon Tools palette with tools to be added to the ribbon.

Customization File
Ribbon tools are created in a CUIx file by placing commands on a ribbon panel. Ribbon panels are made visible in the workspace by adding them to a ribbon tab. All of this is done within the Customize User Interface dialog (on the Manage ribbon tab, on the Customization panel, click the User Interface tool, or type CUI at the Command prompt).

Where to create your ribbon customizations will depend upon your particular situation and preferences, but it is generally considered good practice to keep your customizations separate from the out-of-the-box files whenever possible. This will make it easier to track and maintain them, as well as bring them forward when deploying a new version in the future. The example here will make use of a separate CUIx file (AECRibbonTool.cuix), loaded as a partial customization file, to create ribbon tools on a new ribbon panel, which will then be added to a new ribbon tab. A ribbon panel defined in a partial customization file can be added to a ribbon tab defined in any currently loaded customization file. So even if you want to add your new panel to an existing ribbon tab, you can define it in a separate partial customization file and limit your customization of an out-of-the-box customization file to adding the new panel to the ribbon tab.

Create and Load the Partial Customization File
  1. On the Manage tab, on the Customization panel, click the User Interface tool (or type CUI at the Command prompt).
  2. Click the Transfer tab, if it is not current.
  3. On the right side, click the Create a new customization file button.
  4. In the Save As dialog, navigate to the folder in which you want to save the new customization file, enter a name for the file (AECRibbonTool.cuix will be used below) and click Save.
  5. Click on the Customize tab. At the lower right corner, if the arrow button is pointing to the right (">"), click on that button to expand the dialog. If the button is pointing to the left ("<"), the dialog is already expanded and the button should not be selected.
  6. On the left side, near the top of the Customizations in... pane, click on the Load partial customization file button.
  7. In the Open dialog, navigate to the folder where you saved your new customization file, select the file and click Open.
Create the New Panel
  1. With the Customize User Interface dialog still open, in the Customizations in… pane, verify the drop-down list just below the title bar shows the name of your new customization file (aecribbontool.cuix); if not, select your file name on the drop-down list to filter the information shown to just that of the partial file.
Figure 2 – AECRibbonTool.cuix partial customization file loaded and selected.
  1. In the Customizations in... pane, expand the Ribbon node.
  2. Right click the Panels node, and choose New Panel.
  3. Enter a name for your panel. The example panel will be used on a ribbon tab called "AEC Content", so the panel is named AEC Content - Ribbon Tools. Press ENTER to register the name.
  4. In the Properties pane, notice that both the Name and Display Text properties have been set to your panel name. If you prefixed your panel name with the name of the tab, edit the Display Text property to show just the panel name (Ribbon Tools). This is what will show on the title bar of the panel.
  5. KeyTips provide access to ribbon tools via the keyboard (after pressing the ALT key). For panels with tools in the slideout, enter a string of up to three characters in the KeyTip property to enable the user to expand the panel from the keyboard and access the tools in the slideout. Panels without slideout tools do not need a KeyTip string.
Figure 3 - Ribbon Tools Panel properties.
  1. Repeat Steps 10 - 13 as required to create the panels you need. When you are done creating panels, click the Apply button to save the current changes to the CUIx file.
Populate the New Panel
  1. With the Custom User Interface dialog still open, in the Command List pane at bottom left, click the Create a new command button.
  2. In the Properties pane, enter the following information for the ribbon tool command:
    • Name: Enter the tool name (Vending Machine).
    • Description: Describe the purpose of the tool, for the tool tip.
    • Extended Help File: Optional! See the Customization Guide in the Help for information on creating an XAML file to provide extended help in the tool tip.
    • Command Display Name: Enter a string representing the command macro, for the tool tip (AECRIBBONTOOL Vending Machine).
    • Macro: Enter the macro string that the command will execute directly in the edit box or click on the ellipsis button to enter/edit the macro in the Long String Editor dialog. An AECRibbonTool command macro should look similar to this:
      ^C^C_AecRibbonTool Vending Machine - ribbon;
      Replace Vending Machine - ribbon with the name of the tool palette tool you want the ribbon tool to invoke.
    • Tags: Enter any key words to be associated with your ribbon tool. These are used as part of the command search feature on the Application Menu.
    • Element ID: A default value is entered automatically, and is used to reference the macro programmatically. Enter your own value, if you like.
    • Images: The small (16 x 16 pixels) and large (32 x 32 pixels) images can be specified from external files here, or use the Button Image pane to select from the available images, import a file (BMP) or draw your own.
      TIP: Click the Edit button in the Button Image pane to open the Button Editor. The light gray color at the bottom of the left column of colors will be treated as "clear" allowing the background color of the ribbon to show through, including the blue-green highlight when hovering over a button. Use this color for pixels at the edge, beyond the image proper.
Figure 4 - Vending Machine command properties.
  1. In the Command List pane, left click and drag your newly defined command up onto the Customizations in… pane, position your cursor on the Row 1 node of the ribbon panel created in Step 10 and release the mouse button to add the command to that row.
Figure 5 - Drag-n-drop the command on the panel.
  1. On the right side, you will see a preview image of the panel and have access to the Button Image and Properties panes.
    • Enter a value for the Name property only if you want the ribbon tool name to be different from the command name.
    • Choose a Button Style, which controls the button size and associated text, if any.
    • Most of the other properties will be filled in with the same values as those specified for the command, and changing them here will also change them for the command.
    • Enter up to three characters in the KeyTip property to specify a key sequence unique to the ribbon tab on which the tool’s panel will appear.
  2. Repeat Steps 15 – 18 to create and place additional commands. Add rows, sub-panels, and drop-downs to organize your tools, as desired. When you are done creating and adding commands, click the Apply button to save the current changes to the CUIx file.
Figure 6 – Ribbon Tools panel with Vending Machine as a tool and an Office Equipment split button with three tools on the drop-down.

Create a Ribbon Tab and Add the Panel
  1. Skip down to Step 24 if you intend to add your new panel(s) to an existing ribbon tab. Otherwise, with the Customize User Interface dialog still open, in the Customizations in... pane, right click on the Tabs node and choose New Tab from the context menu.
  2. Type a name for your tab (AEC Content) and press ENTER to register the name.
  3. In the Properties pane, use the Default Display property to set whether or not the tab is automatically added to the Workspace(s) when loaded as a partial CUIx.
  4. Enter up to three characters for the KeyTip property. You must do so for the tab if you want the KeyTips entered for the tools to work.
  5. Skip to Step 25 if you created a new tab for your panel(s). If you are adding your panel to an existing ribbon tab from a different CUIx file, choose All Customization Files in the drop-down at the top of the Customizations in... pane.
    • Expand the nodes to expose Customization File Name > Ribbon > Tabs for the customization file that has the target tab.
    • Expand the nodes to expose the panels to be added, under you newly created customization file (AECRIBBONTOOL).
  6. In the Customizations in... pane, left click and drag the name of the panel to be added (AEC Content - Ribbon Tools) from under the Panels node to the name of the target tab and release the mouse button.
Figure 7 - Drag-n-drop the panel on the tab.
  1. Add additional panels, if you have them. Drag the panel names under a tab to change the order of the panels on the tab.
  2. When you are done adding panels to tabs, click the Apply button to save the current changes to the CUIx file.
Add the Ribbon Tab to Your Workspace (New Tab Only)
You will now need to manually add a new tab to the desired Workspace(s). (If you set the panel to be added when loading as a partial file, you could unload the file and then reload it to add the tab to all Workspaces.)
  1. With the Customize User Interface dialog still open, set the drop-down at the top of the Customize in... pane to All Customization Files.
  2. Under the main customization file (ACA in the example here), expand the Workspaces node and select the name of a Workspace to which you want your new tab added.
  3. In the Workspace Contents pane at top right, click the Customize Workspace button.
  4. In the Customizations in... pane, expand the nodes to expose Partial Customization Files > Customization File Name (AECRIBBONTOOL) > Ribbon > Tabs.
  5. Click the toggle in front of each tab name to be added to the Workspace, or click the toggle in front of the Tabs node to add all of the tabs under the node.
  6. In the Workspace Contents pane, select a tab name and review its properties. Tabs can be included in a Workspace but not displayed, if the Show property is set to No. A ToolPalette Group can be associated with a ribbon tab, if you want.
  7. Click on the Done button to exit the editing of that Workspace.
  8. Repeat Steps 29 - 34 to add your new tab to additional Workspaces.
  9. Click the OK button to accept the changes made, close the CUI dialog and return to the drawing.
Your new tools should now be available. Click on the appropriate tab and try them out.
Figure 8 - The Ribbon Tools panel on the AEC Content tab.

September 30, 2013

ActiveX and AutoLISP Programming Tip 2

In this previous post, I provided the code for getting the AecArchBaseApplication object. This object provides access to a number of values that I previously obtained through DXF access to the dictionaries (which is no longer exposed). Assuming that you have saved the AecArchBaseApplication object to a variable called archBaseApp, the following code examples show how to obtain the noted objects and values:
;;; To get values from the currently active document, you need to get that
;;; object, which is stored in a property of the AecArchBaseApplication:
(setq docActive (vlax-get-property appAecArchBase 'ActiveDocument))

;;; With the active document in hand, you can get the AecArchBase 
;;; Preferences object:
(setq objAecArchBasePref
        (vlax-get-property docActive-AecArchBase 'Preferences)
)

;;; The AecArchBase Preferences object contains a number of values of
;;; interest, including those shown below.

;;; Model "tab" drawing scale:
(vlax-get-property objAecArchBasePref 'DatabaseScale)

;;; The auto-import Layer Standards/Layer Key Style file:
(vlax-get-property objAecArchBasePref 'LayerFile)

;;; The currently active Layer Key Style:
(vlax-get-property objAecArchBasePref 'LayerStandard)
;;; Yes, the property is named "LayerStandard", but the value stored
;;; is the current Layer Key Style, not the associated Layer Standard.

;;; The annotation plot size:
(vlax-get-property objAecArchBasePref 'TextHeight)

;;; Whether or not a DIMSCALE override is automatically created
;;; when you change scales and the current dimension style is not
;;; annnotative:
(vlax-get-property objAecArchBasePref 'CreateDimscaleOverride)

;;; The various units settings can be accessed through the Preferences
;;; object also, such as the current linear unit:
(vlax-get-property objAecArchBasePref 'LinearUnit)

Use vlax-dump-object on the AecArchBase Preferences object to see a list of all of the properties stored there.

In some cases, the values returned will be self-explanatory, such as the DatabaseScale, which is the scale factor associated with the current scale. For example, if the current model tab drawing scale is set to 1/4" = 1'-0", the DatabaseScale value will be 48.0. For items that are yes/no toggles, such as CreateDimscaleOverride, the value will be an integer. No (or false, or unchecked) is 0 (zero). Yes (or true, or checked) could be any other number, but is generally (always?) returned as -1 (negative one). Other values, such as LinearUnit, will seem more cryptic. If the current linear unit is set to "Inch", LinearUnit will return an integer value of 31. Properties such as LinearUnit return "enumerated values" (or "enums"), where each possible value is assigned a numeric value which may or may not have anything to do with the meaning it represents. The AutoCAD® Architecture Developer Help has a section that lists several of the enums used by AutoCAD Architecture and AutoCAD. Expand the AEC Base Automation Reference node and then the Enums node below that, and select the AecBuiltInUnit Enum for a listing of the various values and their meaning. As indicated in the image below, 31 is the enum for Inch.