Place a Systems Library

Valued Contributor
Valued Contributor

 

HELLO

Hi all,

Please find below steps- i have question regarding step 4.

Is it possible to insert system library to assembly A and to point and choose part and face from assembly B (another one)? 

 Step 1.  On the EdgeBar tool, click the Parts Library tab.

 

Step 2.  On the Parts Library tab, drag the systems library assembly

 document and drop it in the assembly window.

 

Step 3.  In the assembly window, define the relationships required

 to position the systems library components.

 

Step 4.  In the assembly window, define the part and face required

 to position the feature you captured.

 

Step 5.  On the SmartStep ribbon bar, click OK.

 When placing systems library members, you can use the Skip button

on the ribbon bar to bypass any relationships you want to apply later.

 

Thank  Mark

 

 

 

Posted by: Mark Goldman
Post date: 4/7/2008 3:43:44 AM

1 REPLY

RE: Place a Systems Library

Valued Contributor
Valued Contributor

 

Mark,

It's not really possible to automate Solid Edge in the way you described.  You will have to programatically perform all of the steps that you listed.  Here is an example that I have that will hoopefully get you started.

 Imports SolidEdgeGeometryImports System.Runtime.InteropServicesModule Module1 Sub Main() Dim objApplication As SolidEdgeFramework.Application = Nothing Dim objDocuments As SolidEdgeFramework.Documents = Nothing Dim objAssembly As SolidEdgeAssembly.AssemblyDocument = Nothing Dim objOccurrences As SolidEdgeAssembly.Occurrences = Nothing Dim objOccurrence1 As SolidEdgeAssembly.Occurrence = Nothing Dim objOccurrence2 As SolidEdgeAssembly.Occurrence = Nothing Dim objPart As SolidEdgePart.PartDocument = Nothing Dim objModels As SolidEdgePart.Models = Nothing Dim objModel As SolidEdgePart.Model = Nothing Dim objRevolvedProtrusions As SolidEdgePart.RevolvedProtrusions = Nothing Dim objRevolvedProtrusion As SolidEdgePart.RevolvedProtrusion = Nothing Dim objRevolvedCutouts As SolidEdgePart.RevolvedCutouts = Nothing Dim objRevolvedCutout As SolidEdgePart.RevolvedCutout = Nothing Dim objFaces As SolidEdgeGeometry.Faces = Nothing Dim objFace As SolidEdgeGeometry.Face = Nothing Dim objGeometry As Object = Nothing Dim objScrewConicalFace As SolidEdgeGeometry.Face = Nothing Dim objNutConicalFace As SolidEdgeGeometry.Face = Nothing Dim objRefToCylinderInScrew As SolidEdgeFramework.Reference = Nothing Dim objRefToConeInNut As SolidEdgeFramework.Reference = Nothing Dim objRelations3d As SolidEdgeAssembly.Relations3d = Nothing Dim objGroundRel As SolidEdgeAssembly.GroundRelation3d = Nothing Dim objRelNuttoScrew As SolidEdgeAssembly.AxialRelation3d = Nothing Try ' Connect to a running instance of Solid Edge objApplication = Marshal.GetActiveObject("SolidEdge.Application") ' Get a reference to the documents collection objDocuments = objApplication.Documents ' Create a new assembly document objAssembly = objDocuments.Add("SolidEdge.AssemblyDocument") ' Get a reference to the occurrences collection objOccurrences = objAssembly.Occurrences ' Add the first occurrence objOccurrence1 = objOccurrences.AddByFilename("C:\Screw.par") ' Get a reference to the occurrence document objPart = objOccurrence1.OccurrenceDocument ' Get a reference to the models collection objModels = objPart.Models ' Get a reference to the one and only model objModel = objModels.Item(1) ' Get a reference to the revolved protrusions collection objRevolvedProtrusions = objModel.RevolvedProtrusions ' Get a reference to the first revolved protrusion objRevolvedProtrusion = objRevolvedProtrusions.Item(1) ' Get a reference to the side faces collection objFaces = objRevolvedProtrusion.SideFaces ' Loop through the faces For Each objFace In objFaces ' Get a reference to the geometry object objGeometry = objFace.Geometry If objGeometry.Type = GNTTypePropertyConstants.igCylinder Then objScrewConicalFace = objFace Exit For End If Next ' Create the first reference objRefToCylinderInScrew = objAssembly.CreateReference( _ objOccurrence1, objScrewConicalFace) ' Add the second occurrence objOccurrence2 = objOccurrences.AddByFilename("C:\Nut.par") ' Get a reference to the occurrence document objPart = objOccurrence2.OccurrenceDocument ' Get a reference to the models collection objModels = objPart.Models ' Get a reference to the one and only model objModel = objModels.Item(1) ' Get a reference to the revolved cutouts collection objRevolvedCutouts = objModel.RevolvedCutouts ' Get a reference to the first revolved cutout objRevolvedCutout = objRevolvedCutouts.Item(1) ' Get a reference to the side faces collection objFaces = objRevolvedCutout.SideFaces ' Loop through the faces For Each objFace In objFaces objGeometry = objFace.Geometry If objGeometry.Type = GNTTypePropertyConstants.igCone Then objNutConicalFace = objFace Exit For End If Next ' Create the second reference objRefToConeInNut = objAssembly.CreateReference( _ objOccurrence2, objNutConicalFace) ' All Occurrences placed through automation are placed "Grounded." ' You must delete the ground constraint on the second Occurrence ' before you can place other relationships. objRelations3d = objAssembly.Relations3d objGroundRel = objRelations3d.Item(2) objGroundRel.Delete() ' Rather than passing literal axes to the AddAxial method, pass ' references to conical faces, Just as you select conical faces ' when you use the interactive Align command. objRelNuttoScrew = objRelations3d.AddAxial( _ objRefToConeInNut, objRefToCylinderInScrew, False) Catch ex As Exception Console.WriteLine(ex.Message) Finally If Not (objRelNuttoScrew Is Nothing) Then Marshal.ReleaseComObject(objRelNuttoScrew) objRelNuttoScrew = Nothing End If If Not (objGroundRel Is Nothing) Then Marshal.ReleaseComObject(objGroundRel) objGroundRel = Nothing End If If Not (objRelations3d Is Nothing) Then Marshal.ReleaseComObject(objRelations3d) objRelations3d = Nothing End If If Not (objRefToConeInNut Is Nothing) Then Marshal.ReleaseComObject(objRefToConeInNut) objRefToConeInNut = Nothing End If If Not (objRefToCylinderInScrew Is Nothing) Then Marshal.ReleaseComObject(objRefToCylinderInScrew) objRefToCylinderInScrew = Nothing End If If Not (objNutConicalFace Is Nothing) Then Marshal.ReleaseComObject(objNutConicalFace) objNutConicalFace = Nothing End If If Not (objScrewConicalFace Is Nothing) Then Marshal.ReleaseComObject(objScrewConicalFace) objScrewConicalFace = Nothing End If If Not (objGeometry Is Nothing) Then Marshal.ReleaseComObject(objGeometry) objGeometry = Nothing End If If Not (objFace Is Nothing) Then Marshal.ReleaseComObject(objFace) objFace = Nothing End If If Not (objFaces Is Nothing) Then Marshal.ReleaseComObject(objFaces) objFaces = Nothing End If If Not (objRevolvedCutout Is Nothing) Then Marshal.ReleaseComObject(objRevolvedCutout) objRevolvedCutout = Nothing End If If Not (objRevolvedCutouts Is Nothing) Then Marshal.ReleaseComObject(objRevolvedCutouts) objRevolvedCutouts = Nothing End If If Not (objRevolvedProtrusion Is Nothing) Then Marshal.ReleaseComObject(objRevolvedProtrusion) objRevolvedProtrusion = Nothing End If If Not (objRevolvedProtrusions Is Nothing) Then Marshal.ReleaseComObject(objRevolvedProtrusions) objRevolvedProtrusions = Nothing End If If Not (objModel Is Nothing) Then Marshal.ReleaseComObject(objModel) objModel = Nothing End If If Not (objModels Is Nothing) Then Marshal.ReleaseComObject(objModels) objModels = Nothing End If If Not (objPart Is Nothing) Then Marshal.ReleaseComObject(objPart) objPart = Nothing End If If Not (objOccurrence2 Is Nothing) Then Marshal.ReleaseComObject(objOccurrence2) objOccurrence2 = Nothing End If If Not (objOccurrence1 Is Nothing) Then Marshal.ReleaseComObject(objOccurrence1) objOccurrence1 = Nothing End If If Not (objOccurrences Is Nothing) Then Marshal.ReleaseComObject(objOccurrences) objOccurrences = Nothing End If If Not (objAssembly Is Nothing) Then Marshal.ReleaseComObject(objAssembly) objAssembly = Nothing End If If Not (objDocuments Is Nothing) Then Marshal.ReleaseComObject(objDocuments) objDocuments = Nothing End If If Not (objApplication Is Nothing) Then Marshal.ReleaseComObject(objApplication) objApplication = Nothing End If End Try End SubEnd Module

 

Posted by: Jason Newell
Post date: 4/16/2008 8:52:24 PM