It appears that Features.BodyFeature doesn't use Displayable object? Where can I find the appropriate call out? The code never enters this loop
For each FeatureItem as DisplayableObject in myFeature.GetEntities
So I'm assuming there are no Displayable Objects within FeatureItem. So how do I move objects to a new layer? The reasoning for my assumption is that the Features.BodyFeature section of this code within the ElseIf loop never actually executes the line "Lw.Writeline("dsgdfg").
for each temp3 as Features.Feature in theSession.Parts.Work.Features
if TypeOf(temp3) is Features.DatumFeature then
dim myDatumFeature as Features.DatumFeature = temp3
for each Datumfeatureitem as DisplayableObject in myDatumFeature.GetEntities
DatumFeatureToMove.add(Datumfeatureitem)
next
elseif TypeOf(temp3) is Features.BodyFeature then
lw.WriteLine("Feature display instance type: " & temp3.GetType.ToString)
dim myFeature as Features.BodyFeature = temp3
for each FeatureItem as DisplayableObject in myFeature.GetEntities
lw.writeline("dsgdfg")
ModelFeatureToMove.add(FeatureItem)
next
end if
next
re: BodyFeature
I don't suggest attempting to collect displayable objects by iterating through the part's features. Instead, try using the part's .Bodies, .Curves, .Datums, and .Sketches collections.
Okay makes sense, I used
Okay makes sense, I used
displayModification5.Apply(workPart.Bodies.ToArray)
and it works great