What is the correct SOLIDWORKS 2026 API method for setting reference point coordinates?
I am trying to update the XYZ coordinates of an existing reference point feature using the SOLIDWORKS 2026 API.
According to the SOLIDWORKS 2026 release notes, reference geometry API functionality was improved to allow direct numeric coordinate input for reference points.
I can successfully obtain the feature and its definition:
Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks: Set swApp = Application.SldWorks
Dim swModel As SldWorks.ModelDoc2: Set swModel = swApp.ActiveDoc
Dim swPart As SldWorks.PartDoc: Set swPart = swModel
Dim swModelDocExt As ModelDocExtension: Set swModelDocExt = swModel.Extension
Dim swFeat As SldWorks.Feature: Set swFeat = swPart.FeatureByName("PT")
Dim swRefPtData As SldWorks.RefPointFeatureData: Set swRefPtData = swFeat.GetDefinition
Dim swRefPt As SldWorks.RefPoint: Set swRefPt = swFeat.GetSpecificFeature2
Dim swMathPt As SldWorks.MathPoint: Set swMathPt = swRefPt.GetRefPoint
Dim bRet As Boolean: bRet = swRefPtData.AccessSelections(swModel, Nothing)
' Set new coordinates (meters in API)
'e.g. swRefPtData.Point = swMathUtility.CreatePoint(...) or swRefPtData.SetPoint x, y, z
swFeat.ModifyDefinition swRefPtData, swModel, Nothing
swRefPtData.ReleaseSelectionAccess
End SubHowever, I cannot find a working method/property to actually modify the point coordinates.
Any working VBA or C# example would be greatly appreciated.
