Finding specific faces of inserted parts

Programming and macros
User avatar
josh
Posts: 263
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 11
x 19
x 456

Finding specific faces of inserted parts

Unread post by josh »

I'm wanting to use InsertPart3 to stick a derived part into another part at a few places. I'd like to use mate constraints rather than just setting the transform so that these inserted bodies move appropriately when the design changes. I see how to add mate constraints to the DerivedPartFeatureData, but I'm having trouble figuring out how to pick the faces of the inserted part that I want to use for mating. The user will select the appropriate faces of the base part, but I want to automatically select the faces of the inserted part.

I know which face it is that I want in the model of the inserted part, but I can't get that face in the context of the part it's inserted into. If I were inserting parts into an assembly, I could use GetCorresponding, but that doesn't work when inserting parts into a part. I thought about assigning names to the faces of the original part, but these are not carried over when inserting into another part.

I thought about transferring the planes when inserting, but this does't work because the relationship between the inserted body and the planes is not maintained. When you use constraints to locate the body, the planes don't actually move along with it.

I'm just about down to the option of making special cuts in the various faces of the insert part so that the areas of the faces I care about are unique, and I can just iterate through the body's faces until I find the one that has the area I know it's supposed to have....
artem
Posts: 26
Joined: Thu Mar 18, 2021 1:31 pm
Answers: 3
x 9
x 73

Re: Finding specific faces of inserted parts

Unread post by artem »

Thanks,
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Post Reply