COD Script Library – Links Fixed

If you’re attempted to download any of my COD Script libraries over the last couple weeks, you may have found the links were bad.

This should now be corrected. The issue was caused when the site was moved to a new hosting provider. Their newer WordPress setup used a different character set than was originally used when the site was originally setup.

Let me know if you notice any issues. There are still a few character anomalies in other pages and tables that will be fixed as I have time.

COD Script Updates – 2019.11.10

I’ve made a couple updates to the Autodesk Fabrication script libraries. If you use them, you can download updated versions from here.

Scripts Updated

  • Job Items
    • All Scripts updated to now include the Item Number which makes it easier to track back report entries to ITM’s in your job.
    • Fix a couple syntax issues in a few scripts which caused errors.
  • Revit Support Report
    • Added Reporting on Revit 2020 status
    • Changed CID/Pattern # 1175 from NO to YES.

Known Issues

End Location properties appear to be crashing 2020.1 Versions of Fabrication. Other versions may/may not crash as well.

Fabrication 2020.1 Update Released

Autodesk has released update 2020.1 for Autodesk Fabrication products CADmep, CAMduct and ESTmep. You can see the small token list of fixes here.

Really not much in the way of fixing the many legacy, multi-release defects that have been piling up. Still no word on the update to plug the security hole in Revit where you’re COST/LABOR data can be mined by others.

One thing to note about this release, it’s not an “Update” that patches your existing system. The Update requires a full install. That means that 2020 versions of CADmep, ESTmep, CAMduct as well as Tracker, CAMduct Components and Remote Entry need to be removed first.

I would NOT recommend installing the update from the Autodesk Desktop App. I’ve tested on multiple systems both personal and corporate and it gets hung indefinitely on the uninstall of the 2020 versions.

If you do want to install the update, I highly recommend uninstalling yourself before adding the 2020.1 versions. Even manual uninstalls of 2020 have been hit or miss. If they hang, they’re usually already uninstalled and using Task Manager to cancel the running MSIEXEC tasks is enough to finish the uninstalls. Best of luck!

Adjusting Liner Lengths on Elbow Throats & Heels in CAMduct

Any sheet metal shop that CNC cuts their liner has likely configured their database to make seam adjustments in the liner developments. These settings are typically global and tell CAMduct to remove the Liner thickness from the Male or Female part of the development.

Another common setting is the compression adjustment in the Insulation Materials. These are all fairly common and self explanatory for most people looking to configure these settings.

Length Adjustments on Radius Elbows

What’s a little less obvious is how to adjust the throat and heel lengths on a radius elbow. If the liner is developed based on metal size, the throat is typically too short and the heel a little long. This is due to the bending allowance of thicker materials. While acoustic liner has a little give but when using something like armorflex for liner, it’s a little more rigid and these lengths can cause issues.

To better understand the Throat and Heel of a radius elbow, we can look at the Top view (cheek). The following image shows the Throat and Heel pointed to with arrows. You’re looking at these parts on their edge.

Prepare Your Fittings

To configure the calculation used for the liner on these parts, you first need to change an option on your ITM. The following image is for a radius elbow (CID 4). Here you’ll want to change the “Insulation Parts” Option to “Wraps Inside“. If you leave this set to the default “Same”, the adjustments made later will have no effect.

Configure Material Adjustments

To make adjustments to the liner calculation, you’ll go to the Insulation Materials and click the “Insulation Developments” button.

This will bring up a dialog where you can make changes to how the liner gets developed on the throats and heels. The various settings are as follows…

Metal Side

Throat & Heel Liner Developed to the same length as the metal fitting.

Air Side

Throat & Heel Lengths Developed Based on the AIR side of the liner thickness.

Middle

Throat & Heel length developed based on the middle of the liner thickness.

Value (Between 0.0 and 1.0)

Value is between 0 and 1 as a percentage of the liner thickness calculated from the metal side.

0 = Same as “Metal Side”
0.5 = Same as “Middle”
1.0 = Same as “Air Side”

Not All Fittings Supported

Not all fittings support the “Insulation Parts” option. You can run one of the Library export scripts that dumps all the OPTIONS to a CSV file and sort in Excel to look for the CID’s in your library that support “Insulation Parts”. Scripts can be found here.

DOS – Still Relevant

Not only is DOS still relevant, its often one of the quickest ways to get some things done.

On XtraCAD.com, someone recently asked how to get the system Date and Time in an Autodesk Fabrication COD script. I provided a solution that uses DOS commands inside a COD script. That solution is explained in more detail here.

DOS’s “Date” Command

Using DOS, we can use the “DATE” command with the “/T” Switch to output the current date to a DOS prompt.

The information given by this simple command is all we need. A script can easily read the data if the output is redirected to a data file.

We’ll get a little more ambitious and get particular on the formatting. We’ll remove the “Tue” and format the date in the format “yyyy.mm.dd”.

To do this, we can use the “FOR” command in DOS.

for /F "tokens=2-4 delims=/- " %A in ('date /T') do echo %C.%A.%B

The Red circled area is the command. It takes the data from the Date command and breaks it apart by the delimiters (DELIMS) which is spaces ( ), forward slashes (/) and dashes (-). You’ll note that the Date doesn’t actually contain any dashes so it’s just ignored.

The TOKENS specifies we want the 2nd thru 4th items of data. They will be assigned sequentially to variables starting with “%A”. The Green circled area is the resulting output ECHO’d to the DOS Window in the format we want.

  • %A = 2nd piece of data (month)
  • %B = 3rd piece of data (day)
  • %C = 4th piece of data (year)

Sending Data to a File

Now that have our DOS command, the next step is to send the output to a file on disk. Doing this will allow the COD script to read it back later.

For this purpose, we use a re-director to pump the data to a file. We simply append a suffix like this…

for /F "tokens=2-4 delims=/- " %A in ('date /T') do echo %C.%A.%B>"C:\Temp\COD Data.Txt"

A few notes about redirecting data to a file….

  1. We use double quotes around the file path and name in case it contains spaces. This way, DOS doesn’t interpret the space as a separator between commands.
  2. The Greater-Than (>) symbol is used to redirect output to a file. If the file already exists, it will be overwritten.
  3. Double Greater-Than (>>) symbols can be used to “append” to the end of an existing file. This is handy if you want to add more data to the same file. If the file doesn’t already exist, it will be created.

We Have DOS, Now for the COD Script

Now that we have our DOS syntax down, we can start writing out COD Script. To start, I typically generate a few variables that help me format things.

REM ------------------------------
REM DQ = Double Quote Character
REM CR = Carriage Return Character
REM ST = Single Tab Character
REM WF = Working File
REM ------------------------------

DIM DQ = ascii(34)
DIM CR = ascii(10)
DIM ST = ascii(9)
DIM WF = "C:\Temp\COD Data.Txt"

Because some of our syntax contains double quotes, and because strings (text) in a COD script also contain double quotes, having multiple double quotes in a row can be confusing. Additionally, sometimes the script has trouble understanding where one string ends vs what’s a string containing a double quote.

To handle this, I set a variable (DQ) that will represent any double quote within a COD Script string. I also use a Carriage Return (CR) variable and a Single Tab (ST) variable for formatting purposes that you’ll see later.

Lastly, I also set a variable for the data file. It’s at the beginning, it’s easy to find and change without having to get in the middle of a lot of confusing formatted string data later.

Executing DOS From the Script

To execute an external command from a script, we can use the EXEC function.

EXEC(<“command”>, <execution mode>, <“command data/arguments”>)

Here’s the 3 pieces of data we’ll need…

  1. <command> = “CMD.EXE”
    This is the DOS Command Interpreter
  2. <execution mode> = exec_wait + exec_show_min
    These are a couple variables that tell the external program to “Wait” until finished before proceeding with the rest of the script and to minimize the Window.
  3. <command/arguments> = The Prior DOS Syntax (with modifications) goes here.

The CMD.EXE program takes an argument of “/C” followed by the command it’s going to execute which is our DOS Syntax. Pay close attention, because here’s where we’re going to have to break up the DOS commands and embed our variables for the embedded double quotes.

The below is a single “String” with double quotes on each end. It also has a lot of double quotes inside the text which will confuse you and your script. This below syntax is WRONG and needs to be corrected….

"/C for /F "tokens=2-4 delims=/- " %A in ('date /T') do echo %C.%A.%B>"C:\Temp\COD Data.Txt""

To do this, it’s easier to illustrate in color. We’re going to take one very long complicated string, and break it into several smaller strings when there’s double quotes within the string.

That is, where ever there’s a double quote within the string, we’re going to make a smaller string before and after, and piece them back together and use our DQ variable to embed the double quote between them.

This works for the first two double quotes. But at the end of the string, we’re going to do something a little different. Here, we want to remove file name and use the WF variable we set earlier to store the file name. And because the filename may have a path, we surround it with DQ variables to embed it in double quotes.

The next piece of code should look like this when we’re done. This will run our DOS command and dump the date to a file,

REM ---------------------
REM Get Date (yyyy.mm.dd)
REM ---------------------

Exec("cmd.exe", exec_wait + exec_show_min, "/C for /F " + DQ + "tokens=2-4 delims=/- " + DQ + " %A in ('date /T') do echo %C.%A.%B>" + DQ + WF + DQ

Reading Our Data File

Now that we’ve dumped the data file to disk, we can read it back in from the COD script using the following code…

DIM myDate
Object myFile as File (WF, forinput+istext)
myDate = myFile.Readline()
myFile.Close()

This code opens the file and reads its data and saves it to a variable. You’ll also note that this code doesn’t add extra double quotes around the WF “Working File” variable. That’s because they aren’t needed here, and will in fact cause problems. The COD Script language is actually better at handling files with and without spaces because it uses a comma (,) as it’s data separator between the file name and file read modes.

Displaying Our Data

Last, we can display the data in a simple debug dialog. Here, you’ll see I make use of the ST variable to place a single tab between the data purely for formatting purposes.

Debug "Date:" + ST + myDate

The Bigger Picture

The following code takes all the above principals and goes a little further. With everything you’ve learned, you should be able to figure out what it’s doing and how. It’s doing all the same things plus a little extra…

  1. Also writing TIME and the USERNAME of the currently logged in Windows User to the data file.
  2. It’s “Appending” the TIME and USERNAME using “>>” instead of “>” that DATE uses.
  3. It’s reading 3 lines of our data file
  4. The data file is deleted after it’s read leaving our system clean of temporary files.
  5. The data is displayed by also using the CR (Carriage Return) variable to start new lines for the additional pieces of data.
REM ------------------------------
REM DQ = Double Quote Character
REM CR = Carriage Return Character
REM ST = Single Tab Character
REM WF = Working File
REM ------------------------------

DIM DQ = ascii(34)
DIM CR = ascii(10)
DIM ST = ascii(9)
DIM WF = "C:\Temp\COD Data.Txt"

REM ---------------------
REM Get Date (yyyy.mm.dd)
REM Get Time (hh:mm)
REM Get User (login name)
REM ---------------------

Exec("cmd.exe", exec_wait + exec_show_min, "/C for /F " + DQ + "tokens=2-4 delims=/- " + DQ + " %A in ('date /T') do echo %C.%A.%B>" + DQ + WF + DQ)
Exec("cmd.exe", exec_wait + exec_show_min, "/C for /F " + DQ + "tokens=1-2 delims=: " + DQ + " %A in ('time /T') do echo %A:%B>>" + DQ + WF + DQ)
Exec("cmd.exe", exec_wait + exec_show_min, "/C echo %username%>>" + DQ + WF + DQ)

REM ---------
REM Read Data
REM ---------

DIM myDate
DIM myTime
DIM myUser

Object myFile as File (WF, forinput+istext)

myDate = myFile.Readline()
myTime = myFile.Readline()
myUser = myFile.Readline()
myFile.Close()

REM ----------------
REM Delete Data File
REM ----------------
Exec("cmd.exe", exec_default + exec_show_min, "/C DEL " + DQ + WF + DQ)

REM ------------
REM Display Data
REM ------------

Debug "Date:" + ST + myDate + CR + "Time:" + ST + mytime + CR + "User:" + ST + myUser

Whole program can be downloaded here…

COD Script Updates – Part 2

I didn’t plan up updating scripts again so soon but I found a couple more undocumented properties. I thought I’d post them sooner rather than later.

The two ITM properties I found are “BOX” and “E-Tag“.

BOX is only visible from CAMduct. It’s intended purpose appears to be for specifying a “Box” for the ITM in question for shipping purposes but you could use it or anything. Despite it being visible only in CAMduct, using COD Scripts, you can read and write it from ESTmep or CADmep too.

E-TAG is visible from any of the Fabrication products. It’s used for Equipment Tags. You can see both properties from here if in CAMduct or only E-Tag is ESTmep or CADmep.

Scripts Updated

  • All Debug Scripts – Nothing major, just formatting in the comments section.
  • WriteAll_Props (Job).cod – Updated to support BOX & E-TAG properties.
  • WriteAll_Props (Library).cod – Updated to support BOX & E-TAG properties.

Scripts Added

  • Debug ITEM Box.cod
  • Debug ITEM E-Tag.cod
  • WriteAllBox (Job).cod
  • WriteAllETag (Job).cod
  • WriteAllBox (Library).cod
  • WriteAllETag (Library).cod

You can download the *current* versions here.

Scripting property reference has also been updated here.

COD Script Updates

I’ve made a couple updates to the Autodesk Fabrication script libraries. If you use them, you can download updated versions from here.

Scripts Updated

  • Debug
    • Debug ITEM Library.cod
    • Debug ITEM Sealant.cod
  • Job Items
    • WriteAllLibrary (Job).cod
    • WriteAllSealant (Job).cod
    • WriteAll_Props (Job).cod
  • Library Items
    • WriteAllLibraries (Library).cod
    • WriteAllSealant (Library).cod
    • WriteAll_Props (Library).cod

Issues Corrected

Issue 1: Scripts accessing the “Library” property were failing on CID/Pattern 2199. Scripts have been updated to watch for this and report it as an ‘Unknown‘ Library.

Issue 2: Some CID/Patterns can be configured to be pipework or duct work depending on the “Pipework” option’s “Yes/No” status. Scripts were updated to properly report or ignore this property depending on the Sealant value being present.

If the option is set to “Yes“, the pattern is a pipework item. If set to “No”, the pattern is a sheet metal item. Sheet metal items contain the “Sealant” property where as Pipework items do not.

This condition is present in the following CID/Patterns…

149838 902110112381239
12401241124212471248

Special thanks to Kyle Speropoulos of MMC Contractors in Kansas City for alerting me to this issue.

Autodesk BIM360 Docs – Licensing Enforcement Starts Soon

My apologies for misleading headline, but I feel the issue is important enough to grab your attention with.

To start, I’m not aware of any upcoming enforcement action by Autodesk regarding their BIM360 Docs service. But that doesn’t mean it’s not coming. Project teams may get hit like a ton of bricks if they are not prepared. When it’s about to happen, nobody knows.

Dude! Why The Alarmist Tone?

If you’ve been around the Autodesk ecosystem long enough, you’ll know Autodesk has always supported enforcement of software licensing. It’s speculated the rise of AutoCAD’s popularity was because of the ease of pirating back in the day. But as Autodesk grew, so did their enforcement activities. These activities include software licensing audits of which I’ve participated in two (100% compliant I might add)

I’m a firm believer in Intellectual Property rights (IP) and applaud Autodesk’s efforts to protect their investment. With this I have no problem.

Times Have Changed

Things have changed in recent years. Typical pirating of desktop software was either an intentional or negligent act. With current subscription models and cloud based services, piracy is a much smaller issue now that it once was. This new economy of subscription licenses and cloud services should render licensing concerns a thing of the past right? Wrong!

If you were a user of the old A360 based Collaboration for Revit platform (C4R), you might recall about October 2017 (if I recall correctly) many project teams across the US were unable to work. Call it an “oversight” or “defect”, call it what you want. The issue was C4R was not properly enforcing licensing. To be clear, it wasn’t enforced at all…until it was.

To make matters worse, your company could assign licenses to your users, or another partner on the project could provide the licenses. It’s not real clear where you’re ability to “use” C4R was coming from because even without a license, you could view the files on the web. Inquires to Autodesk would always result in no help citing privacy concerns.

Needless to say, once Autodesk “flipped the switch“, project teams all over had users unable to work until they procured more licenses. Autodesk responded that a notice was posted in the public Autodesk forums. It also wasn’t possible to Email everyone involved despite having Autodesk ID’s be the user’s Email address. Not sure how they said that with a straight face.

In short, Autodesk has a confusing licensing model, was not helpful to customers trying to understand their compliance, allowed easy inadvertent over usage and then pulled the plug. Oops. Guess we won’t do that again.

Looks Like Déjà Vu (All Over Again)

Did you know, BIM360 Docs licensing is also NOT being enforced currently. Additionally, license usage and counts are not available in your accounts portal either like your other products. Simply put, BIM360 Docs licenses are automatically assigned/unassigned as you add or removed project members on your BIM360 Docs account.

The only place to find your current status is from the Account Admin page and clicking on the Analytics menu. Here, you can see I clearly added 61 users when there’s only 12 licences available. Each users had NO functional limitations.

61 of 12 BIM360 Docs Licenses Used.

And it only gets worse from here. Any Project Administrator can add anyone to your account they want. In fact, you Want project administrators so they can efficiently on-board your team members. You may even make other trade partners outside your firm Project Administrators so they can on-board their own staff. The issue is, Project Administrators have no access to view licensing usage, only the Account Administrator which you don’t want to give wide access to.

So here you have a situation where you can easily become over consumed and not realize it. Autodesk assures me they do routine audits and allow people to “true up” or they shut the licenses down. But given past history, are you confident the right person will get notice? Are you confident enforcement won’t be turned on and your project won’t get shut down for a couple of days while your order is placed?

The Bigger Issue

For such a large company so focused on software compliance (historically), it seems very odd to me that this is the second “oops“. And it seems ironic that for something that should be so simple like Cloud Service licensing, that it can be so horribly confusing.

“BIM360 Docs licenses are automatically assigned. They don’t stay with the user. However, you get one for free with BIM360 Design which a user can take with them.”

Does the person managing your licensing know what that means?

And it’s just disappointing that it’s so easy to become “over-licensed” with very little visibility. They let everyone into the concert with no security, shut the door and just as the band start playing, announce they you all didn’t have enough tickets.

Call me a conspiracy theorist but it is starting to appear like this is an intentional deployment and utilization strategy. Get teams dependent on the product, then pass around the collection plate.

One Final Complaint

If you’ve heard enough, you may not want me to point out that Autodesk likely collects revenue for multiple of the same licenses for the very same users. Seriously, stop reading if you’d prefer to remain in the dark.

BIM360 Docs licensing (to be “legal”) requires licenses for every active member in an accounts membership list. If I host a BIM360 project for the entire team and the team wants to use BIM360 Docs, I need licenses for the entire project team. Sounds reasonable. But there are other projects hosted by other firms. My team needs access to those as well. Those firms are paying for licenses (if they’re legal) for my team…who already has licenses from my account.

The Conclusion – I Promise

In my opinion, there is no excuse for the confusing, sloppy mess that is BIM360 licensing. It’s not hard. Others like Adobe and Microsoft have figured it out.

I’m not someone who’s against BIM360. It’s done great things for project teams and workflow. Seriously! But somebody really needs to start raising awareness to these types of issues. While we’re all giddy little nerds with a cool new toy doing neat things, as an industry, we’re neglecting the legal terms and other business risks. It’s not as fun but it’s just as important. I hope others start raising these types of issues or I’d expect more of the same from Autodesk.

Rant Mode – OFF

ESTmep Cost Exposed in Revit

If you’re a user of ESTmep and Revit Fabrication parts, consider yourself warned. I’ve recently had some dialog with an industry colleague and the discussion of Cost data in Revit came up.

We know that that a Revit file which uses Fabrication Parts contains a copy of your Fabrication Configuration (Database). We also know that the Fabrication Extension for Revit now allows you to run reports. Those reports can also report on Cost data. That’s generally a good thing in most firms using ESTmep, exposing that Cost data to Revit users can be very helpful.

Now when you send someone your Revit model, they do NOT have access to your database (Unless you send that to them a well). Without your database, the Fabrication Add-In will not find the reports and the option is grayed out.

You also can’t change the configuration either because the drop down is disabled. They need your database to do anything….maybe.

So this sounds like we’re OK but let me assure you that’s not the case. Your database isn’t “available” to the person who had your Revit file but it is contained within the Revit file itself. And even though the Revit API’s don’t give you access to the costing data, it can be extracted.

I won’t go into details for the sake of security in our industry but rest assured, there is a process where as a user can extract your cost data. This includes being able to figure our your vendor pricing multipliers.

What To Do?

That leaves the question about what to do. Some may be familiar with the option in Edit Configuration that disables the storing of EST tables in DWG files. This has NO effect or control of Revit. Sure would be nice if it did nit that’s not the case.

So there’s really 2 options that I can see….

  1. Remove or Rename the COST.MAP, ETIMES.MAP, FTIMES.MAP and SUPPLIER.MAP tables from your database. These are where labor rates, times and costs are stored. Without these tables,, Revit can not store this information in the model. If you’re previously had a Revit model with this information saved, rename/remove the files and reload your configuration and the data will be removed. The down size is you’ll no longer be able to use ESTmep.
  2. Make a copy of your database without the COST.MAP, ETIMES.MAP, FTIMES.MAP and SUPPLIER.MAP tables and have Revit point to that. Each time you update your Fabrication database, you’ll need to refresh this copy. It’s fairly easy to script this process and have those files removed. The down side is you’ll no longer have access to Cost data in Revit but at least you can keep using ESTmep internally.

If you feel this is unacceptable, please submit a support ticket with Autodesk. The more people that raise the issue, the more likely that it will be addressed in a future release or update. To date, all they told me is the option I’ve outlined are the ONLY way to address the issue.

IT Hack Every BIM/CAM Manager Should Know

How many times have you had to reconfigure a system because a server changed? Remapped Drive letters? Links that used UNC paths? It’s downright annoying when IT needs to replace a server and it’s name is different. But it is understandable…systems get old and outdated and need upgrading or replacing.

What I don’t understand is why we use server names at all. Most Ethernet networks use IP addresses to route traffic, not server names. But nobody can ever remember all those numbers. When you type a server name, it pings the DNS server to locate the IP address of that server. Makes sense right.

But we don’t have to use server names…or IP addresses. DNS can be configured with a CNAME Alias (CNAME – Canonical Name). A CNAME Alias is just another human friendly piece of text that’s used to point to another Server Name, IP address or even another CNAME Alias.

What a CNAME Alias do for us?

To understand what a CNAME Alias can do for us, lets take the example of license server. All your client software points to the server name…let’s say is’s something like “P-LA-LIC01“. Now your IT rolls out a new server for licensing…it’s not going to be “P-LA-LIC02“. All your clients need to be updated to the new server name. Depending on the sophistication of your IT and the software they mightbe able to push an update. But more often than not, the local CAD/BIM Manager is left updating clients.

With a CNAME Alias, you could create a nice user friendly name like “ADSK-LICENSE“. All your software would use this name instead of the server name.

This CNAME Alias is setup on your DNS server. Most IT groups won’t give you access but if you know how it works, you can request and have them set it up for you. Just tell them you want a CNAME Alias named “ADSK-LICENSE” that points to “V-LA-LIC01(ADSK-LICENSE -> V-LA-LIC01). Now when you’re ready to cut you users over to the new license server, have them update the DNS record for the alias to the new server overnight. The next morning, everybody is pointed to the new server, no reconfiguration required.

If someone has left on their computer, they may need to reboot to see the changes. In the unlikely event is still doesn’t work, they can open a DOS prompt and flush the DNS cache with the command line “IPCONFIG /FLUSHDNS

Where does this work?

Just about where ever and ever where you would type a server name. You can make a drive letter using an Alias. You can use an Alias in a UNC path. We can even specify them to point to the IP address of network printer or other equipment.

The only real down side to using a CNAME Alias is that it doesn’t show up when browsing your network, But all things considered, that’s not a bad idea. If it were up to me, no user anywhere would ever know the names of the servers…only the Aliases. I really don’t know why this trick isn’t used more often. IT uses it for their own purposes, it just rarely gets implemented to affect the users. Using this approach, I’ve migrated hundreds of users in multiple locations to new servers with a 3 second DNS update in the evening. I suggest you give it a try.