I can specify tangency for a Boundary Surface feature through the GUI, but not through the API (SW 2023). The macro below creates a Boundary Surface feature using an edge and a sketch in direction 1, and two sketches in direction 2. I use SetNetBlendCurveData to specify that the surface should be tangent to the adjacent surface at the edge, but it does not do anything. The tangency condition shows as "None" in the feature editor.
Am I doing something wrong?
To reproduce - open
And run this macro
Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Sub main() Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Part.ClearSelection2 True boolstatus = Part.Extension.SelectByRay(4.60402598577908E-02, 5.47375260908869E-02, 0, 0.693215603158396, -5.96710331570602E-02, -0.718255870383048, 1.36715650098695E-04, 1, False, 8193, 0) boolstatus = Part.Extension.SelectByRay(0.05, 5.29903810567663E-02, 0, 0.693215603158396, -5.96710331570602E-02, -0.718255870383048, 1.36715650098695E-04, 2, True, 8449, 0) boolstatus = Part.Extension.SelectByID2("3DSketch3", "SKETCH", 3.49999999999991E-02, 5.34807621135326E-02, 2.50000000000026E-03, True, 16385, Nothing, 0) boolstatus = Part.Extension.SelectByID2("3DSketch2", "SKETCH", 3.49999999999991E-02, 5.34807621135326E-02, 2.50000000000026E-03, True, 8194, Nothing, 0) boolstatus = Part.Extension.SelectByID2("3DSketch1", "SKETCH", 6.50000000000009E-02, 5.34807621135326E-02, 2.50000000000026E-03, True, 16386, Nothing, 0) Dim myFeature As Object ' 3rd argument of SetNetBlendCurveData is TangentType. 3 corresponds to swTangencyType_e.swTangencyAllFaces Set myFeature = Part.FeatureManager.SetNetBlendCurveData(0, 0, 3, 0, 1, True) Set myFeature = Part.FeatureManager.SetNetBlendCurveData(0, 1, 0, 0, 1, True) Set myFeature = Part.FeatureManager.SetNetBlendDirectionData(0, 32, 0, False, False) Set myFeature = Part.FeatureManager.SetNetBlendCurveData(1, 0, 0, 0, 1, True) Set myFeature = Part.FeatureManager.SetNetBlendCurveData(1, 1, 0, 0, 1, True) Set myFeature = Part.FeatureManager.SetNetBlendDirectionData(1, 32, 0, False, False) Set myFeature = Part.FeatureManager.InsertNetBlend2(2, 2, 2, False, 0.0001, False, True, True, True, False, -1, -1, False, -1, False, False, -1, False, -1, True, False) End Sub
I wanted to attach the macro as an "swp" file, but I got the "format is not authorized" error when I tried to attach it as "media". Please let me know in a comment if you know of a way to do it.
Thanks!