Replace iAssemblyMember

Replace iAssemblyMember

Anonymous
Not applicable
308 Views
1 Reply
Message 1 of 2

Replace iAssemblyMember

Anonymous
Not applicable
Hello,

In a assembly I want to replace a occurence which is a iAssemblyMember. (iAssemblyFactory1.iam with active member Position2)
Herefor I've copied the iAssemblyFactory1 file to another filename. (iAssemblyFactory2.iam with active member Position2)
Now I want to replace iAssemblyFactory1 with iAssemblyFactory2.
If I do this manualy inside Inventor with replace I get the change to select which member to use. Inventor makes then automatically the new Member in it's own directory.
With VB6 I can replace iAssemblyFactory1 with iAssemblyFactory2 but then the iAssemblymember1 (Position2) is repaced by the iAssemblyFactory2 which is not good.
How can I replace the members?
I use INV11 SP2 and VB6.

Geert

I tried this code which replace a member1 with the new factory2.

Dim oOccurrences As Inventor.ComponentOccurrences
Set oOccurrences = oAsmDoc.ComponentDefinition.Occurrences
Dim oOccurrence As Inventor.ComponentOccurrence

Set oOccurrence = oSelectSet.Item(i)
'strNew_Modelnaam = new iAssemblyFactory file
oOccurrence.Replace strNew_Modelnaam, False

How can I select a member of the Factory to replace?
I do know its name already. (is the same as the origin)




I want to replace this occurence with another iAssembly Member
0 Likes
309 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I think the best option would be to create the member from the desired row
in iAssemblyFactory2 (using iAssemblyFactory.CreateMember). You'll now have
a member file on disk. Now, replace the occurrence with this new member
file.

Sanjay-

wrote in message news:5583024@discussion.autodesk.com...
Hello,

In a assembly I want to replace a occurence which is a iAssemblyMember.
(iAssemblyFactory1.iam with active member Position2)
Herefor I've copied the iAssemblyFactory1 file to another filename.
(iAssemblyFactory2.iam with active member Position2)
Now I want to replace iAssemblyFactory1 with iAssemblyFactory2.
If I do this manualy inside Inventor with replace I get the change to select
which member to use. Inventor makes then automatically the new Member in
it's own directory.
With VB6 I can replace iAssemblyFactory1 with iAssemblyFactory2 but then the
iAssemblymember1 (Position2) is repaced by the iAssemblyFactory2 which is
not good.
How can I replace the members?
I use INV11 SP2 and VB6.

Geert

I tried this code which replace a member1 with the new factory2.

Dim oOccurrences As Inventor.ComponentOccurrences
Set oOccurrences = oAsmDoc.ComponentDefinition.Occurrences
Dim oOccurrence As Inventor.ComponentOccurrence

Set oOccurrence = oSelectSet.Item(i)
'strNew_Modelnaam = new iAssemblyFactory file
oOccurrence.Replace strNew_Modelnaam, False

How can I select a member of the Factory to replace?
I do know its name already. (is the same as the origin)




I want to replace this occurence with another iAssembly Member
0 Likes