Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm trying to unfold an edited sheet metal component occurrence of an assembly with no success. I took a rule that works in a part and transposed it to an assembly but it doesn't work. The component occurrence is well edited but I can't unfold it. Something escapes me. Can someone help me?
Attached is the rule I use.
Sub Main() Dim oAsm As AssemblyDocument = ThisDoc.Document Dim oAsmCompDef As AssemblyComponentDefinition = oAsm.ComponentDefinition ' Edit ComponentOccurrence Dim oPartOccurrence As ComponentOccurrence = oAsmCompDef.Occurrences.ItemByName("Part1:1") oPartOccurrence.Edit Dim oPartDoc As PartDocument = oPartOccurrence.Definition.Document Dim oSMCD As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition Dim oBendsEnum As BendsEnumerator = oSMCD.Bends Dim oSMF As SheetMetalFeatures = oSMCD.Features Dim oCM As CommandManager = ThisApplication.CommandManager ' Choix de la face de référence Dim oFace As Face = oCM.Pick(SelectionFilterEnum.kPartFaceFilter,"Sélectionner la face de référence") If IsNothing(oFace) Then Return ' Dépliage complet de la pièce Dim oBends As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection Dim oUnFoldFeat As UnfoldFeature For Each oB In oBendsEnum oBends.Add(oB) Next oUnFoldFeat = oSMF.UnfoldFeatures.Add(oFace, oBends) 'oPartOccurrence.ExitEdit(ExitTypeEnum.kExitToParent) End Sub
Thank you in advance. Vincent.
Solved! Go to Solution.