Solid Edge Part Type Library
Range Method
Specifies the x coordinate of the lower-left corner the referenced object.
Specifies the y coordinate of the lower-left corner of the referenced object.
Specifies the z coordinate of the lower-left corner of the referenced object.
Specifies the x coordinate of the upper-right corner of the referenced object.
Specifies the y coordinate of the upper-right corner of the referenced object.
Specifies the z coordinate of the upper-right corner of the referenced object.
Description
Returns the high and low range values for the referenced object.
Syntax
Visual Basic
Public Sub Range( _
   ByRef x1 As Double, _
   ByRef y1 As Double, _
   ByRef Z1 As Double, _
   ByRef x2 As Double, _
   ByRef y2 As Double, _
   ByRef Z2 As Double _
) 
Parameters
x1
Specifies the x coordinate of the lower-left corner the referenced object.
y1
Specifies the y coordinate of the lower-left corner of the referenced object.
Z1
Specifies the z coordinate of the lower-left corner of the referenced object.
x2
Specifies the x coordinate of the upper-right corner of the referenced object.
y2
Specifies the y coordinate of the upper-right corner of the referenced object.
Z2
Specifies the z coordinate of the upper-right corner of the referenced object.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objModel As SolidEdgePart.Model
    Dim objPatternPlane As SolidEdgePart.RefPlane
    Dim objFeatArray(1 To 2) As Object
    Dim objProfile As SolidEdgePart.Profile
    Dim objRPatterns As SolidEdgeFrameworkSupport.RectangularPatterns2d
    Dim objRPattern As SolidEdgeFrameworkSupport.RectangularPattern2d
    Dim objPattern As SolidEdgePart.Pattern
    Dim vRange As Variant
    Dim minX As Double, minY As Double, minZ As Double, maxX As Double, maxY As Double, maxZ 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
    'Create base model for patterning
    If CreateModel(objDoc) <> "" Then
        MsgBox "Error in creating the base model"
        Exit Sub
    End If
    Set objModel = objDoc.Models(1)
    '***** Create a Rectangular Pattern of SmartPattern Type
    ' Create a new Profile object
    Set objPatternPlane = objDoc.RefPlanes.AddParallelByDistance(ParentPlane:=objDoc.RefPlanes(1), _
                                                                 Distance:=0.025, normalside:=igRight, local:=True)
    Set objProfile = objDoc.ProfileSets.Add.Profiles.Add(objPatternPlane)
    ' Get the RectangularPatterns2d object on the Profile
    Set objRPatterns = objProfile.RectangularPatterns2d
    ' Add an item to the RectangularPatterns2d collection
    Set objRPattern = objRPatterns.Add(OriginX:=-0.035, OriginY:=-0.035, _
                                       Width:=0.1, Height:=0.075, Angle:=0, OffsetType:=sePatternFillOffset, _
                                       XCount:=1, YCount:=1, XSpace:=0.025, YSpace:=0.025)
    Set objFeatArray(1) = objModel.ExtrudedProtrusions(2)
    Set objPattern = objModel.Patterns.Add(NumberOfFeatures:=1, _
                                           FeatureArray:=objFeatArray, Profile:=objProfile, PatternType:=seSmartPattern)
    If objPattern.Status <> igFeatureOK Then
        MsgBox "Problem in creating rectangular pattern of SmartPattern type"
    End If
    'Get the range of the Pattern feature
    vRange = objPattern.Range(x1:=minX, y1:=minY, z1:=minZ, x2:=maxX, y2:=maxY, z2:=maxZ)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objModel = Nothing
    Set objPatternPlane = Nothing
    Set objFeatArray(1) = Nothing
    Set objFeatArray(2) = Nothing
    Set objProfile = Nothing
    Set objRPatterns = Nothing
    Set objRPattern = Nothing
    Set objPattern = Nothing
End Sub
See Also

Pattern Object  | Pattern Members

Send comments on this topic.