StructuraFrame Section CutLength

 

Hello

I'am trying to get a BOM of a assembly with a structuralframe but I do not manage to get the cut length of each section of the frame, I do manage to get the cutlength of the full frame but I am not able to get the seccions (getseccions) to do so with each secction.

What type of objects are going to be in the array that is returning GetSections method.

 

ForEach oFrame In oAsm.StructuralFrames

Dim i AsInteger = 1

Dim obj AsObject = Nothing

dim sections(0 to 100) as ??????

 oFrame.CutLength(x1, obj)' I got it OK

 

oFrame.GetSections(i, sections)

Next

 

 

 

Thanks in advance.

 

Posted by: Xabi Bikuna Losada
Post date: 6/30/2008 3:34:17 AM

3 REPLIES

RE: StructuraFrame Section CutLength

 

I almost found the solution

I share it for anybody how just in case want it.

The programing for VB6 and from VB.NET is a bit different

VB6 version ' works ok

  Dim doc As SolidEdgeAssembly.AssemblyDocument

  Dim oframe As SolidEdgeAssembly.StructuralFrame

  Dim namefi As String

  Set doc = objApp.Documents.Open(Filename:=namefi)

  Dim i As Long

  Dim sections(0 To 100) As Long

  Dim length As Double

  Dim objocu As SolidEdgeAssembly.Occurrence

 

  For Each oframe In doc.StructuralFrames

    Call oframe.GetSections(i, sections)

    For x = 0 To i - 1

      Call oframe.SegmentCutLength(sections(x), length)

      oframe.ReturnOccurrenceForGivenSectionID sectionid:=sections(x), occurrenceasobject:=objocu

    Next

  Next

 

VB.NET version, the ReturnOccurrenceForGivenSectionID function always returs Nothing

How can it be? Is the .NET interop wrong?

Dim doc As SolidEdgeAssembly.AssemblyDocument

  Dim oframe As SolidEdgeAssembly.StructuralFrame

  Dim namefi As String

  Set doc = objApp.Documents.Open(Filename:=namefi)

  Dim i As Integer

  Dim sections(0 To 100) As Integer

  Dim length As Double

  Dim objocu As SolidEdgeAssembly.Occurrence

Dim obj as Object = Nothing

 

  For Each oframe In doc.StructuralFrames

    Call oframe.GetSections(i, sections)

    For x = 0 To i - 1

          oFrame.SegmentCutLength(sections(x), length, obj)   

         oFrame.ReturnOccurrenceForGivenSectionID(SectionId:=sections(x), OccurrenceId:=obj, OccurrenceAsObject:=objOcu)

    Next

  Next

 

 

Posted by: Xabi Bikuna Losada
Post date: 7/1/2008 12:05:26 AM

RE: StructuraFrame Section CutLength

 

Sorry about the previous solution

The VB6 version is working perfectly, and althoug the second (VB.NET) one is quite the same,

the ReturnOccurrenceForGivenSectionID function always returns nothing instead of the occurrence  

Does anybody know why can it be? Can someone help me?

Thanks in advance

 

 

Posted by: Xabi Bikuna Losada
Post date: 7/1/2008 8:48:43 AM

RE: StructuraFrame Section CutLength

 

Hi,

I have the same problem and I open the PR 1673548.

 

Delki Trolese

 

Posted by: Delki Trolese
Post date: 7/14/2008 8:56:34 PM