Could someone help me with this - I have tried everything I can think of but it always fails.
I have a macro that sets various properties for parts within an assembly - I want to add a bit more to it to ground the part at 0,0,0.
I can delete existing relationships and put the part in the correct position, but just can't get the adding a ground relationship.
My last effort was this, which I adapted from the Programmers guide -
objRelation3d = objRelations3d.AddGround(objOccurrence)
Solved! Go to Solution.
Yes, they are.
I have code to remove any relationships but I have also manually removed all relationships then run my macro.
Still doesn't apply the ground.
I'm off work until next week so will check it out anyway.
I believe your are using the wrong Relations3d collection object.
When you are going to delete existing relationships, then you will need to access the collection from your occurrence:
When you are assembling occurrences in an assembly document, you will need to add relations in the document's collection:
This is working for me!
(BTW: It is also used this way in the AddGround example in the SDK help)