lklo
Industrial
- Nov 24, 2010
- 226
hi -
maybe someone here can give me a little (big) help.
I have created a VB journal that can wavelink some selected bodies from any components ,to some other selected components.
every things work fine , but anyway not.
The positions of the linked bodies in the components-part´s is everybody in ABS zero . I need to have them positioned in their position as in the topassembly.
I think the Xform´s are the problem - but I´m not quite sure how to control these Xform´s.
lklo
maybe someone here can give me a little (big) help.
I have created a VB journal that can wavelink some selected bodies from any components ,to some other selected components.
every things work fine , but anyway not.
The positions of the linked bodies in the components-part´s is everybody in ABS zero . I need to have them positioned in their position as in the topassembly.
I think the Xform´s are the problem - but I´m not quite sure how to control these Xform´s.
lklo
Code:
For inx As Integer = 0 To TargetBody.length - 1
selobj = TargetBody(inx)
lw.WriteLine(selobj.NAME) ' output til test
If ufs.Assem.IsOccurrence(selobj.tag) = True Then
temp = ufs.Assem.AskPrototypeOfOcc(selobj.tag)
End If
ufs.Assem.SetWorkPart(temp) ' skifter workpart
For inx2 As Integer = 0 To ToolBody.length - 1
selobj = ToolBody(inx2)
lw.WriteLine(selobj.NAME)
'----------------------------
Dim MyComponent = selobj 'måske ok
Dim CompPart As Part = MyComponent.Prototype
Dim LinkedFeat As NXOpen.Tag = NXOpen.Tag.Null
Dim ObjInPart As NXOpen.Tag = ufs.Assem.Askworkpart()
Dim ufxform As NXOpen.Tag = NXOpen.Tag.Null'>>>>>>>>>>>>>>>>>>>> problem ???????
Dim lkxform = CType(NXObjectManager.Get(ufxform), Xform)'>>>>>>> problem ???????
For Each aBody As Body In compPart.Bodies
lw.WriteLine(ObjInPart & " --- ") ' output til test
ufs.So.CreateXformAssyCtxt(ObjInPart, MyComponent.Tag, NXOpen.Tag.Null, ufxform)
ufs.Wave.CreateLinkedBody(aBody.tag, lkxform, ObjInPart, True, LinkedFeat)
ufs.Obj.SetName(LinkedFeat, MyComponent.Name)
Next
'-----------------------------
Next
Next