Add sweep to specific solid body

Add sweep to specific solid body

kaikraft91
Participant Participant
339 Views
2 Replies
Message 1 of 3

Add sweep to specific solid body

kaikraft91
Participant
Participant

Hello people,

 

I am currently struggeling to add a sweep to the second solid body in my part.  The code snippet below isnt working.

 

oSweep = oPCD.Features.SweepFeatures.AddUsingPath(oProfile, oPath, kJoinOperation)
oSweep.SetAffectedBodies(oPCD.SurfaceBodies.Item(2))

 How can I tell the Sweep that it is part of this or that solid body?

 

0 Likes
340 Views
2 Replies
Replies (2)
Message 2 of 3

kaikraft91
Participant
Participant

So 30min after asking the question on the forums, after searching for an answer for 4 hours before that, I find the solution myself:

 

You dont tell the sweep to affect a body, but to affect a collection, which the body is part of:

 

Dim oSolidCollection As ObjectCollection
oSolidCollection = ThisApplication.TransientObjects.CreateObjectCollection
oSolid = oPCD.SurfaceBodies.Item(2) oSolidCollection.Add(oSolid)
oSweep = oPCD.Features.SweepFeatures.AddUsingPath(oProfile, oPath, kJoinOperation) oSweep.SetAffectedBodies(oSolidCollection)

 

 

0 Likes
Message 3 of 3

mecanicu
Advocate
Advocate
I think .AffectedBodies.Add(oPCD.SurfaceBodies.Item(2)) do same thing but as Object not Collection.
Mite be wrong!!!
0 Likes