The Automation Hub

Your team's own scripts, in one catalogue, run by name from chat on the CAD system you have open. Import a SOLIDWORKS macro, an Inventor iLogic rule, an NX journal, a Solid Edge macro or a compiled .NET assembly once, and from then on anybody can run it without opening a code editor.

What it holds

The hub is a catalogue of scripts that already exist. It does not write them and it does not translate them: a SOLIDWORKS macro stays a SOLIDWORKS macro. What the hub adds is a name, a description, the parameters it takes, and a single way to run any of them from the chat.

CAD systemWhat you can put in
SOLIDWORKSVBA macros (.swp, .swb) and a compiled .NET assembly (.dll)
Autodesk InventoriLogic rules (.iLogicVb, and the plain .vb files most published rules are saved as) and a .dll
Siemens NXJournals (.cs, .vb) and a .dll
Solid EdgeMacros (.bas) and a .dll
AutoCADA compiled .NET assembly (.dll). AutoCAD's own SCRIPT files and LISP routines are run as commands instead, from Native Macros & Automation.
Two file extensions mean two different things. .vb is the extension of an NX VB journal and of nearly every published Inventor iLogic rule; .cs and .bas are shared the same way. Say which CAD system a file belongs to when you import it. If you do not, the code itself is read and the CAD system is decided from what the script calls, which is right far more often than the extension is.

Importing

One file

Import C:\team\scripts\rename_features.swp into the Automation Hub
Import C:\team\scripts\set-checked-by.vb into the Automation Hub as an Inventor rule

The file is copied into your own hub folder, so moving or deleting the original afterwards does not break the catalogue entry. An import that lands on a name already in use keeps both: the second copy is stored under a timestamped file name.

A whole folder

Import every script in C:\team\scripts into the Automation Hub

Each file becomes its own catalogue entry, and the answer is one line per file naming the CAD system and the type it was filed as. Read that list before you run anything: a rule filed under the wrong CAD system is the one failure that looks like a broken script.

A pack somebody sent you

Import the pack at C:\Downloads\frame-tools.sphereharness-pack

A .sphereharness-pack file carries skills, automations and macros together. What happens when a name already exists, and why a pack is sometimes refused outright, is covered in Macros and in the libraries help inside the product.

Importing never runs anything. An import writes files: the script's text and a catalogue entry, nothing else. That is true of a single file, of a folder, and of a pack somebody emailed you. Nothing in a pack executes because you imported it.

A note on SOLIDWORKS .swp files

A .swp is usually a compound binary file rather than plain text. On import its VBA source is read out of the file so you can ask about it later, and the macro is not run to get at it. What you can read back is what was really in the file: a macro whose stored module text is only a fragment is treated as having no readable source rather than being handed on as if it were the macro.

The second thing to know about a recorded .swp is about running it, not importing it. A macro recorded against one model often picks its geometry by a reference stored in that model. On a different part the selection finds nothing and the next line fails, typically with VBA's Run-time error 91. Three of five real recorded macros behaved exactly that way in testing. They are not broken; they need a selection, so select the face or edge first and then run.

Running one by name

What automations are available for SOLIDWORKS?
Show me the details of the "Rename features" automation
Run the "Rename features" automation with prefix set to BR- on the active part

Asking for the details first is worth the extra prompt. It lists the parameters the automation declares, with their types and defaults, and for a .NET assembly it also lists the methods the assembly offers. The automation runs on the CAD session you have open; when more than one CAD is running, say which, or set the Target.

When a script needs something you did not give it

Three different things are meant by "needs input", and each is answered in a different place:

.NET assemblies

A compiled assembly is the one kind of automation that can hold dozens of separate entry points, so it works slightly differently from a macro.

Name the method and it runs

In AutoCAD, run the method AcadSample.Shapes.DrawSquare from C:\team\tools\AcadSample.dll with sideMm 40

A fully qualified Namespace.Class.Method is run directly. One call, no list, no extra round trip. Arguments you name are matched to the method's parameters, and a value that matches no parameter of the method is reported back to you rather than quietly dropped.

Do not name one and you get the list

What can I run in C:\team\tools\AcadSample.dll?

When nothing resolves to a method, nothing runs, and what comes back is the assembly's callable methods, one line per class, with each method's parameters and return type. The likely entry points are listed first and marked. On AutoCAD the marked name is the command name the assembly registers, which is what actually runs. You then say which one you want, and that second request runs it.

AcadSample.dll: 4 executable methods (* = entry point; a:int? = optional; app/doc/db/ed/session/part are supplied by the CAD):
AcadSample.Shapes: SHDEMOCIRCLE*(); SHDEMOLINES*(); CountModelSpace(db:db)->int; DrawSquare(db:db,sideMm:double)->int
Nothing was executed.

Parameters the CAD supplies for itself, such as the application, the document, the database or the NX session, are shown as their short token and are not yours to fill in. A parameter with a trailing ? can be left out. A long assembly is capped and you are told how to narrow the list, and if you named a class that exists and a method on it that does not, the list is narrowed to that class automatically.

The list is read from the file, and nothing is loaded. Building it reads the assembly's own tables and closes the file again. No code in it is loaded, no start-up code runs, and the file is not left locked. That is also why listing what an assembly offers never raises a permission card: a request that names neither a class nor a method cannot execute anything on any CAD system. Every real run still asks.

Siemens NX: journals play in the session you are sitting in

An NX journal runs inside your open NX session, on the work part. You watch it happen and you undo it the way you undo anything else. A journal that reads the work part when no part is open is refused before it plays, with that reason, rather than being run into a null reference.

When a journal fails, you get the journal's own exception and its own line number, not a generic "failed to replay" message. A compile error comes back as NX's own compiler text. Neither puts up a dialog.

A journal cannot be interrupted once NX has it, so there is no timeout. The elapsed time is reported instead. Expect the first play in a session to take a few seconds longer than the ones after it, because the compiler and the runtime start up on the first one.

NX licensing, as measured. A .NET assembly of your own that is not signed with an NX signature needs the NX Open Author licence on the seat that runs it; an assembly signed with Siemens' own signing tool runs without consulting that licence. Playing a journal from source drew the same Author licence on the seat this was measured on, so plan for it rather than assuming source journals are licence-free. Nothing about this is a SphereHarness setting: it is NX's own check, and the seat either holds the licence or it does not.

AutoCAD: an assembly outside a trusted folder is refused

AutoCAD decides for itself which folders it will load code from, through its SECURELOAD and TRUSTEDPATHS settings. SphereHarness checks that policy before loading anything:

The fix is yours to make, in AutoCAD, and it is the same fix you would make to run the assembly by hand: add the folder to Options → Files → Trusted Locations (the TRUSTEDPATHS setting), or move the assembly into a folder that is already trusted. A path entry names one exact folder unless it ends in \..., which includes its subfolders; AutoCAD's own install tree and the ApplicationPlugins folders are trusted already. The refusal names the folder and the current setting value, so you can see which of the two to change.

If either setting cannot be read, the request is refused as well. An unreadable policy is not permission.

"It ran" is never the answer

A script that returns without an error has not necessarily done anything. Every run is judged by reading the document before and after, and you are told the difference:

CAD systemWhat is read back
SOLIDWORKSFeature count, solid body count, total volume in mm³, or component count in an assembly
Autodesk InventorFeature, body, sketch and occurrence counts
Siemens NXSketch, body and feature counts, and solid volume
Solid EdgeFeature, model, profile-set and occurrence counts
AutoCADModel-space entity count and drawing extents

Three outcomes follow from that, and they read differently on purpose:

If the read-back itself cannot be taken, the answer says the change is not verified. It never invents a number to fill the gap. See Verifying Results.

Sharing with your team

Your catalogue is local. Imported scripts live in your own folder on your own PC, and nothing about them is sent to any server unless organisation sharing is switched on. The server holds your account, your licence and your usage, not your team's scripts.

To get a script to a colleague:

A compiled .dll automation is never put in a pack. The export says so by name and carries on with the rest. Send the assembly itself and import it on the other PC, where its folder policy and its licence are that machine's business.

Use case: a folder of somebody else's scripts, running from chat

A four-person design team has scripts nobody currently maintains: a folder of iLogic rules a former colleague wrote, three NX journals recorded for a project last year, and one AutoCAD assembly a contractor delivered with no documentation. Nobody runs them because nobody remembers how. Here is the whole path, with the sentences typed and the answers that came back.

The read-back numbers in this section are from real runs on AutoCAD 2026, Inventor 2025, Siemens NX 2306 and SOLIDWORKS 2024. Your own numbers will differ; the shape of the answer will not.

1. Get them into the catalogue

Import every script in C:\team\scripts into the Automation Hub

Fifteen files went in and fifteen catalogue entries came out, each naming the CAD system and the type it was filed as: five NX journals, five Inventor rules, five SOLIDWORKS macros. The five Inventor rules were plain .vb files, and were filed as Inventor rules rather than NX journals because the code named Inventor's own objects.

What have I got, by CAD system?

Answer: Found 15 automation(s), and filtering by CAD system gives 5, 5 and 5. A search for extrude found four, across two CAD systems, which is the point of a catalogue rather than a folder.

2. Run an Inventor rule

The first rule stamps a drawing's title block. Ask what it does before running it:

Show me the details of the "set-checked-by" automation
Run it on the open part

The rule ran, and the answer did not stop at "it ran": the part's properties were read back afterwards, and Checked By and Date Checked now hold values that were empty before. The two other stamping rules in the folder behaved the same way, and each left the other rules' properties untouched, which is what a read-back can prove and a status code cannot.

One rule in that folder does not run at all: it is a VBA macro that somebody saved with a rule's extension, and Inventor refuses it in its own words, naming the structure it expected. That refusal is the script's, not ours, and it arrives verbatim.

3. Run the NX journals, including the one that fails

Run the "journal-extrude" automation in NX on the open part

It played inside the open NX session, on the work part, and the answer read sketches 0->1, bodies 0->1, volume 912 000.000000 mm³, in 2.9 seconds. The rectangle journal gave sketches 0->1, features 1->3 in 2.7 seconds. Both are visible in the session and undoable.

Now run "journal-polygon"

This one fails, and the useful part is how it fails:

The journal itself threw: System.NullReferenceException ... journal0.cs:line 38

Line 38 is line 38 of the team's own journal file, and it is theSession.ActiveSketch.FindObject("Origin"). So the journal is not broken: it is a fragment recorded from inside an open sketch, and it needs a sketch already active. The part was left unchanged, which was measured rather than assumed. Ten minutes of guessing became one line of evidence.

4. Run the contractor's AutoCAD assembly, without documentation

Nobody knows what is in the assembly, so do not pretend to:

What can I run in C:\team\tools\AcadSample.dll?

Four callable methods came back, two of them marked as AutoCAD commands, each with its parameters. Nothing was loaded to produce that list and nothing ran. Now pick one:

Run the circle one

Answer: ran and CHANGED the document: modelSpaceEntities 0->1. From here on you do not need the list. The name is known, so name it:

Run AcadSample.Shapes.DrawSquare with sideMm 40

One call, no list: modelSpaceEntities 0->4, extentsX (unset)->40, extentsY (unset)->40. It returned: 4. Four entities for a square, extents of 40 for a side of 40, and the method's own return value of 4. Three independent things agreeing is what makes it safe to put on a schedule.

5. And when a script quietly does nothing

The same team has a SOLIDWORKS assembly with a method that was supposed to modify the part. It returns cleanly. The answer is still not a success:

'SwSample.dll!SwSample.Bosses.Touch' ran and reported no error,
but the document is UNCHANGED - ran, changed nothing (features 19, bodies 1, volumeMm3 2000).

Compare that with the run before it on the same part, which reported features 17->19, bodies 0->1, volumeMm3 0->10800 for a 30 by 30 by 12 boss. 10,800 mm³ is exactly 30 × 30 × 12, so the millimetre conversion inside somebody else's assembly and the measurement of the result agree. That is the check worth making on any script you did not write.

What the team ended up with

See also