The SOLIDWORKS 2027 API adds seven new members in three areas: saving and reopening models in a frozen state, upgrading legacy sheet metal features, and better control of exploded views and balloons in drawings. This post walks through each one with VBA macro examples, and what it means for your macros and add-ins.
Everything here comes from the SOLIDWORKS API 2027 release notes, which are published as a pre-release (PR1) help. Names and behavior can still change before the final release, so test against the shipping version before you deploy.
What is new at a glance
| Interface | Member | What it does |
|---|---|---|
| IModelDocExtension | IsFrozen | Tells you if the model is frozen |
| IModelDocExtension | SaveAndFreeze | Saves the model in a frozen state |
| IModelDocExtension | UnFreeze | Unfreezes the model |
| IModelDocExtension | UpgradeLegacySheetMetal | Upgrades legacy sheet metal features to the current architecture |
| IView | ShowExploded2 | Shows a named exploded view in a drawing view |
| IView | GetVerticesOfVisibleEntities | Gets vertices of visible entities, exploded or not |
| IBalloonOptions | QuantityDistance | Sets the distance between a balloon and its BOM quantity |
1. Save models in a frozen state
The biggest addition is support for frozen models. A frozen model is saved so that it is protected from being rebuilt or changed until it is unfrozen. Three new methods on IModelDocExtension give you full control from code.
- IsFrozen returns true if the document is frozen.
- SaveAndFreeze(FreezeOption) saves the model and freezes it. It returns true if the model was frozen.
- UnFreeze(FreezeOption) unfreezes it again. It returns true if the model was unfrozen.
Both SaveAndFreeze and UnFreeze take a value from the new swFreezeOptions_e enumeration:
| Value | Meaning |
|---|---|
| swFreezeOptions_Default (0) | Freeze or unfreeze the part. For assemblies and drawings it behaves like AllComponents. |
| swFreezeOptions_AllComponents (1) | Freeze or unfreeze the top level assembly or drawing and all component models. |
| swFreezeOptions_TopOnly (2) | Freeze or unfreeze only the top level assembly or drawing. |
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swExt As SldWorks.ModelDocExtension
Dim frozen As Boolean
Dim unfrozen As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swExt = swModel.Extension
If Not swExt.IsFrozen Then
' Save the assembly and every component in a frozen state
frozen = swExt.SaveAndFreeze(swFreezeOptions_AllComponents)
End If
' Later, unfreeze only the top level assembly
unfrozen = swExt.UnFreeze(swFreezeOptions_TopOnly)
End Sub
Where this helps
- Released designs: freeze an assembly and its components when it reaches Released in your PDM workflow, so nobody rebuilds it by accident.
- Batch tools: check IsFrozen before your macro rebuilds, saves or edits a file, and skip or unfreeze it on purpose.
- Customer deliveries: hand over a model that opens exactly as it was saved.
If you run batch rebuild or property update tools, add an IsFrozen check now. A frozen file that your code tries to change is a support call waiting to happen.
2. Upgrade legacy sheet metal from code
UpgradeLegacySheetMetal upgrades legacy sheet metal features to the current architecture. It takes no arguments and returns true if the features were upgraded.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim errors As Long
Dim warnings As Long
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel.Extension.UpgradeLegacySheetMetal Then
swModel.Save3 swSaveAsOptions_Silent, errors, warnings
End If
End Sub
Vaults that have collected sheet metal parts over many SOLIDWORKS versions can now be upgraded in a batch instead of part by part. Run it on a copy first, compare the flat patterns, then roll it out.
3. Exploded views in drawings
Two new IView methods improve how drawings work with exploded assemblies.
ShowExploded2
ShowExploded2(ShowExploded, ExplodeViewName) shows a named exploded view in the drawing view. Pass true and the name of the exploded view to show it, or false to show the collapsed state. Unlike the older method, you choose exactly which exploded view appears.
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim shown As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swView = swDraw.ActiveDrawingView
shown = swView.ShowExploded2(True, "ExplView1")
End Sub
GetVerticesOfVisibleEntities
GetVerticesOfVisibleEntities gets the vertices of the visible entities of a component in a drawing view, regardless of its exploded state. You pass the component and an entity type from swViewEntityType_e, and get back the visible entities and, for each one, an array of MathPoint objects for its vertices.
Dim swComp As SldWorks.Component2 ' a component shown in swView
Dim vEntities As Variant
Dim vCoordinates As Variant
swView.GetVerticesOfVisibleEntities swComp, swViewEntityType_Edge, vEntities, vCoordinates
This is useful for tools that place annotations, dimensions or balloons automatically, because you get positions that match what is actually visible in the view.
4. Balloon quantity distance
IBalloonOptions has a new QuantityDistance property. It gets and sets the distance between the BOM item quantity and its balloon, so automated ballooning can match your drafting standard without manual cleanup. Like all API lengths, the value is in meters.
Dim swOptions As SldWorks.BalloonOptions
Set swOptions = swModel.Extension.CreateBalloonOptions
swOptions.QuantityDistance = 0.003 ' 3 mm
Should you update your code?
- Batch tools that rebuild, save or edit files: add an IsFrozen check.
- Workflows that release designs: consider SaveAndFreeze as part of your release automation.
- Older sheet metal libraries: plan a test of UpgradeLegacySheetMetal on a copy.
- Drawing automation with exploded views or balloons: switch to ShowExploded2 and try QuantityDistance.
Each member is marked as available from SOLIDWORKS 2027 SP0, revision 35.0. If your add-in also supports older versions, check the SOLIDWORKS revision before calling them.
Need help with the SOLIDWORKS API?
Blue Byte Systems builds SOLIDWORKS and SOLIDWORKS PDM add-ins, tasks and integrations, and Amen Jlili leads the SOLIDWORKS APIs User Group. If you want help updating your tools for 2027, book a short call.