Solid Edge Part Type Library
Parent Property
Description
Returns the parent object for the referenced object.
Property type
Read-only property
Syntax
Visual Basic
Public Property Parent As Object
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objBaseProfile As SolidEdgePart.Profile
    Dim objBaseProfArray(1 To 2) As SolidEdgePart.Profile
    Dim objBase As SolidEdgePart.Model
    Dim objRegHoleData As SolidEdgePart.HoleData
    Dim objRP As SolidEdgePart.RefPlane
    Dim objRegHoleProfile As SolidEdgePart.Profile
    Dim objRegHole As SolidEdgePart.Hole
    Dim objHDCParent As SolidEdgePart.PartDocument
    Dim lngStatus As Long
    ' 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
    ' *** creating the an extruded protrusion base feature
    ' creating a circular profile for the base feature and validating it
    Set objBaseProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:=objDoc.RefPlanes(1))
    Call objBaseProfile.Circles2d.AddByCenterRadius(x:=0, y:=0, Radius:=0.1)
    lngStatus = objBaseProfile.End(ValidationCriteria:=igProfileClosed)
    If (lngStatus <> 0) Then
        MsgBox "Profile for the base feature is not closed"
    End If
    ' creating the extruded protrusion and validating it
    Set objBaseProfArray(1) = objBaseProfile
    Set objBase = objDoc.Models.AddFiniteExtrudedProtrusion(NumberOfProfiles:=1, _
                                                            ProfileArray:=objBaseProfArray, ProfilePlaneSide:=igSymmetric, ExtrusionDistance:=0.05)
    objBaseProfile.Visible = False
    If (objBase.ExtrudedProtrusions(1).Status <> igFeatureOK) Then
        MsgBox "AddFiniteExtrudedProtrusion method of models object fails"
    End If

    ' *** creating a Regular Hole using the Holedatacollection object
    ' creating the hole data for a regular hole
    Set objRegHoleData = objDoc.HoleDataCollection.Add(HoleType:=igRegularHole, _
                                                       HoleDiameter:=0.01, BottomAngle:=90)
    ' creating a profile for the regular hole and validating it
    Set objRP = objDoc.RefPlanes.AddParallelByDistance(ParentPlane:=objDoc.RefPlanes(1), _
                                                       Distance:=0.025, NormalSide:=igRight)
    Set objRegHoleProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:=objRP)
    Call objRegHoleProfile.Holes2d.Add(xcenter:=0, ycenter:=0)
    lngStatus = objRegHoleProfile.End(ValidationCriteria:=igProfileClosed)
    If (lngStatus <> 0) Then
        MsgBox "Profile for the regular hole is not closed"
    End If
    ' creating the regular hole on the base feature and validating it
    Set objRegHole = objBase.Holes.AddFinite(Profile:=objRegHoleProfile, _
                                             ProfilePlaneSide:=igLeft, FiniteDepth:=0.02, Data:=objRegHoleData)
    If (objRegHole.Status <> igFeatureOK) Then
        MsgBox "AddFinite method of the Holes object fails"
    End If
    objRegHoleProfile.Visible = False
    ' getting the parent object of the HoleDataCollection object
    Set objHDCParent = objDoc.HoleDataCollection(1).Parent
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objBaseProfile = Nothing
    Set objBaseProfArray(1) = Nothing
    Set objBase = Nothing
    Set objRegHoleData = Nothing
    Set objRP = Nothing
    Set objRegHoleProfile = Nothing
    Set objRegHole = Nothing
    Set objHDCParent = Nothing
End Sub
See Also

HoleDataCollection Collection  | HoleDataCollection Members