Sculpt Feature Remove Sick references

Sculpt Feature Remove Sick references

They_Call_Me_Jake
Advocate Advocate
302 Views
1 Reply
Message 1 of 2

Sculpt Feature Remove Sick references

They_Call_Me_Jake
Advocate
Advocate

I have a problem where a user can change the quantity of a pattern on a part that is copied into another part and then Sculpt cut. If the quantity is increased there is no issue, the cut updates fine, but if the quantity is decreased then there are sick references that cause the sculpt to fail altogether. My issue is that I can't find anything anywhere on how to remove those sick references so the sculpt can build properly. I have tried "Update" and "Rebuild" on the part that has the sculpt in it but nothing works. The only thing I have found is the "Recover" tool which when run and you just follow each step will fix the issue but that "Recover" tool is not available from the API. The other thing that is weird is if the quantity is changed manually by editing the pattern through the UI you can hit rebuild and it rebuilds fine but if the quantity is changed thru code then "Rebuild" doesn't work and the Sculpt fails.  I know that people asking for help should include the code they have already tried to show you are actually trying to figure it out on your own first but therein lies the problem is that I can't find anything anywhere that I can even try. Can anyone point me in the right direction. 

0 Likes
303 Views
1 Reply
Reply (1)
Message 2 of 2

JhoelForshav
Mentor
Mentor

Hi @They_Call_Me_Jake 

I don't know if I understand you problem completely, but if surfaces are deleted that the sculpt were using, you could try this:

Dim oSculpt As SculptFeature = ThisDoc.Document.ComponentDefinition.Features.SculptFeatures(1) 'Get the sculpt feature
oSculpt.Surfaces = oSculpt.Surfaces

oSculpt.Surfaces will only contain the surfaces that are actually still there, so setting it to itself will update the sculpt. I tried in i a part where i built a sculpt with multiple surfaces and then just deleted some of them. The sculpt were sick, but running the code afterwards fixed it 🙂