AssemblyFeaturesRevolvedCutouts.Add method



does anyone have an example or can explain what the arguments of this method mean.


Public Function Add( _
   ByVal nNumScopeParts As Long, _
   ByRef pScopeParts() As Unknown, _
   ByVal nNumProfiles As Long, _
   ByRef pProfiles() As Unknown, _
   ByVal pRefAxis As Unknown, _
   ByVal ExtentType As FeaturePropertyConstants, _
   ByVal ExtentSide As FeaturePropertyConstants, _
   ByVal profileSide As FeaturePropertyConstants, _
   ByRef pdAngle As Double, _
   ByVal KeyPointOrTangentFace As Unknown, _
   ByRef KeyPointFlags As KeyPointExtentConstants, _
   ByVal pFromSurface As Unknown, _
   ByVal pToSurface As Unknown _
) As AssemblyFeaturesRevolvedCutout





Re: AssemblyFeaturesRevolvedCutouts.Add method

I got some information from other methods and have currently defined the code till here

The only thing that is still the problem is that it bugs on the SetAxisOfRevolution.

Is this maybe only possible in a part document and not in a assembly document ?


                                    Dim loAsmLayout As SolidEdgeAssembly.Layout
                                    loAsmLayout = m_Document.Layouts.Add(loAsmRefPlane)
                                    loAsmLayout.Name = "HOLE"

                                    Dim loAsmProfile As SolidEdgePart.Profile
                                    loAsmProfile = loAsmLayout.Profile

                                    Dim loRadius As Double
                                    loRadius = (loDiameter / 2) / 1000
                                    Dim loHeight As Double
                                    loHeight = (loOuterDiameter / 2) + 0.01

                                    Dim loLines2D As SolidEdgeFrameworkSupport.Lines2d
                                    loLines2D = loAsmProfile.Lines2d

                                    With loLines2D
                                        .AddBy2Points(0, 0, loRadius, 0)
                                        .AddBy2Points(0, 0, 0, loHeight)
                                        .AddBy2Points(0, loHeight, loRadius, loHeight)
                                        .AddBy2Points(loRadius, 0, loRadius, loHeight)

                                    End With


                                    '* Do the cutout
                                    Dim objRefAxis As SolidEdgePart.RefAxis
                                    objRefAxis = loAsmProfile.SetAxisOfRevolution(loAsmProfile.Lines2d.Item(2))

                                    Dim loAsmFeatures As SolidEdgeAssembly.AssemblyFeatures
                                    loAsmFeatures = m_Document.AssemblyFeatures

                                    Dim loAsmRevCutouts As SolidEdgeAssembly.AssemblyFeaturesRevolvedCutouts
                                    Dim loAsmRevCutout As SolidEdgeAssembly.AssemblyFeaturesRevolvedCutout

                                    'Dim loAsmQuery As SolidEdgeAssembly.Query
                                    'loAsmQuery = m_Document.Queries.Add("HOLE")
                                    'loAsmQuery.LoadSubassemblies = True
                                    'loAsmQuery.SearchSubassemblies = True
                                    'loAsmQuery.AddCriteria(SolidEdgeAssembly.QueryPropertyConstants.seQueryPropertyName, "NAME", SolidEdgeAssembly.QueryConditionConstants.seQueryConditionContains, loOccurenceTube.Name)

                                    Dim loProfilesArray(1) As Object
                                    Dim loOccurenceArray(1) As Object

                                    loProfilesArray(0) = loAsmProfile
                                    loOccurenceArray(0) = loOccurenceTube

                                    loAsmRevCutouts = loAsmFeatures.AssemblyFeaturesRevolvedCutouts
                                    loAsmRevCutout = loAsmRevCutouts.Add(1, loOccurenceArray, _
                                                                         1, loProfilesArray, _

SolidEdgePart.FeaturePropertyConstants.igFinite, _
                                                                         SolidEdgePart.FeaturePropertyConstants.igLeft, _
                                                                         SolidEdgePart.FeaturePropertyConstants.igLeft, _
                                                                         2 * PI, _
                                                                         Nothing, _
                                                                         Nothing, _

                                    loAsmRevCutout.Name = "HOLE"

Re: AssemblyFeaturesRevolvedCutouts.Add method

On thought i hade is that the Profile was not validated. So i've added next command after drawing 4 lines.


Dim loStatus As Long
                                    loStatus = loAsmProfile.End(SolidEdgePart.ProfileValidationType.igProfileClosed)


returns the value 0 so it should be validated but still i'm bugging on the command



The Profile is created on a assembly layout wich may cause the trouble cause i'm not in a part environment ?

Re: AssemblyFeaturesRevolvedCutouts.Add method

There seem to be a bug in the SetAxisOfRevolution method on the assembly profile. You should file an IR on that.

Anyway, you should add some code to connect the end points of your lines and set the axis of revolution BEFORE you end and validate your profile.

The following code should work, if the bug would be fixed:

' ASM: Create assembly feature (revolved cutout)
Const loDiameter As Double = 10
Const loOuterDiameter As Double = 1
Dim m_Document As SolidEdgeAssembly.AssemblyDocument = objApp.ActiveDocument
Dim loAsmRefPlane As SolidEdgeAssembly.AsmRefPlane = m_Document.AsmRefPlanes.Item(3) ' Front (xz) plane
Dim loAsmLayout As SolidEdgeAssembly.Layout = m_Document.Layouts.Add(loAsmRefPlane)

' Create the lines
Dim loAsmProfile As SolidEdgePart.Profile = loAsmLayout.Profile
Dim loRadius As Double = (loDiameter / 2) / 1000
Dim loHeight As Double = (loOuterDiameter / 2) + 0.01
Dim loLines2D As SolidEdgeFrameworkSupport.Lines2d = loAsmProfile.Lines2d
Dim loLine1 As SolidEdgeFrameworkSupport.Line2d = loLines2D.AddBy2Points(0, 0, loRadius, 0)
Dim loLine2 As SolidEdgeFrameworkSupport.Line2d = loLines2D.AddBy2Points(0, 0, 0, loHeight)
Dim loLine3 As SolidEdgeFrameworkSupport.Line2d = loLines2D.AddBy2Points(0, loHeight, loRadius, loHeight)
Dim loLine4 As SolidEdgeFrameworkSupport.Line2d = loLines2D.AddBy2Points(loRadius, 0, loRadius, loHeight)

' Connect the endpoints
Dim loRels2D As SolidEdgeFrameworkSupport.Relations2d = loAsmProfile.Relations2d
With loRels2D
  .AddKeypoint(loLine1, SolidEdgeConstants.KeypointIndexConstants.igLineStart, loLine2, SolidEdgeConstants.KeypointIndexConstants.igLineStart)
  .AddKeypoint(loLine1, SolidEdgeConstants.KeypointIndexConstants.igLineEnd, loLine4, SolidEdgeConstants.KeypointIndexConstants.igLineStart)
  .AddKeypoint(loLine2, SolidEdgeConstants.KeypointIndexConstants.igLineEnd, loLine3, SolidEdgeConstants.KeypointIndexConstants.igLineStart)
  .AddKeypoint(loLine3, SolidEdgeConstants.KeypointIndexConstants.igLineEnd, loLine4, SolidEdgeConstants.KeypointIndexConstants.igLineEnd)
End With

' Set the axis of revolution
Dim loRefAxis As SolidEdgePart.RefAxis = loAsmProfile.SetAxisOfRevolution(loLine2)

' End and validate the profile
Dim st As Integer = loAsmProfile.End(ProfileValidationType.igProfileClosed + ProfileValidationType.igProfileRefAxisRequired)

' Do the cutout
Dim loAsmFeatures As SolidEdgeAssembly.AssemblyFeatures = m_Document.AssemblyFeatures
Dim loAsmRevCutouts As SolidEdgeAssembly.AssemblyFeaturesRevolvedCutouts = loAsmFeatures.AssemblyFeaturesRevolvedCutouts
Dim loOccurrenceTube = m_Document.Occurrences.Item(1) ' just to initialize the occurrence
Dim loProfilesArray() As Object = New Object() {loAsmProfile}
Dim loOccurenceArray() As Object = New Object() {loOccurrenceTube}
Dim loAsmRevCutout As SolidEdgeAssembly.AssemblyFeaturesRevolvedCutout
loAsmRevCutout = loAsmRevCutouts.Add(1, loOccurenceArray, 1, loProfilesArray, loRefAxis, _
                                     SolidEdgePart.FeaturePropertyConstants.igFinite, _
                                     SolidEdgePart.FeaturePropertyConstants.igLeft, _
                                     SolidEdgePart.FeaturePropertyConstants.igLeft, _
                                     2 * Math.PI, Nothing, 0, Nothing, Nothing)


Re: AssemblyFeaturesRevolvedCutouts.Add method

Thank you very much for your replay,

i' ve created already an IR wich was converted to a problem.

Hopefully they can solve it in a new .NET assembly for the framework 2.0