Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgePart.PartDocument
Dim objModel As SolidEdgePart.Model
Dim objBody As SolidEdgeGeometry.Body
Dim objEdgesCol As Object
Dim objEdges As Object
Dim objEdgeSets(1 To 2) As Object
Dim objRound As SolidEdgePart.Round
Const TESTFILE = "T:\vbtests\testcases\cube.par"
Dim dblRadiusArray(1 To 2) As Double
' Report errors
Const PI = 3.14159265358979
' Create/get the application with specific settings
On Error Resume Next
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
Err.Clear
Set objApp = CreateObject("SolidEdge.Application")
Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
On Error GoTo 0
' Close active document if any
Call objDoc.Close
' Open a testcase file
Set objDoc = objApp.Documents.Open(TESTFILE)
' Get the body object of the model
Set objModel = objDoc.Models(1)
Set objBody = objModel.Body
'Create an Empty EdgeCollection
Set objEdgesCol = objBody.CreateCollection(Type:=seEdgeCollection)
'Get the collection object of edges from the Body object
Set objEdges = objBody.Edges(EdgeType:=igQueryAll)
'Add few Edges into the collection
Call objEdgesCol.Add(objEdges(1))
Call objEdgesCol.Add(objEdges(3))
'Create a round with the collection
Set objEdgeSets(1) = objEdgesCol
dblRadiusArray(1) = 0.005
Set objRound = objModel.Rounds.Add(NumberOfEdgeSets:=1, EdgeSetArray:=objEdgeSets, _
RadiusArray:=dblRadiusArray)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objBody = Nothing
Set objEdgesCol = Nothing
End Sub