How to Join FamilyInstance?

How to Join FamilyInstance?

choshQT24J
Enthusiast Enthusiast
709 Views
6 Replies
Message 1 of 7

How to Join FamilyInstance?

choshQT24J
Enthusiast
Enthusiast

My purpose:
I have to difference family file (.rfa).
let's say "a.rfa"(Family A) and "b.rfa"(Family B).

"a.rfa" is void. 

"b.rfa" is solid.

I need to use revit .net api to use Family A to open a hole on Family B.

I have done some researches.
Look like there are two ways for join gemory in revit api.
CombineElement and BooleanOperation.

No matter what I try, I'm having problems.
CombineElement need to use GenericForm. But I don't know how to get GenericForm in FamilyInstance.
BooleanOperation need to use Solid. But I don't know how to get Solid in FamilyInstance.

Could Anyone give me some advice. Thanks.
Sorry for my English.

Accepted solutions (1)
710 Views
6 Replies
Replies (6)
Message 2 of 7

WillianMayrink
Participant
Participant

Try to use  a class InstanceVoidCutUtils, the method AddInstanceVoidCut()

Message 3 of 7

satouak
Participant
Participant

Thanks  Willian for the reply!!
Same Issue Here. I have tried and got the error "Autodesk.Revit.Exceptions.ArgumentException: 'The element is not a family instance with an unattached void that can cut.
Parameter name: cuttingInstance"

0 Likes
Message 4 of 7

TripleM-Dev.net
Advisor
Advisor

Hi @choshQT24J ,

 

First off, can you do it manually in the Revit UI to Cut Family B with Family A.

If that doesn't work then it's also not possible in the API.

 

The error looks like Family A isn't set to cut, in the family check the option "Cut with voids when loaded".

 

- Michel

0 Likes
Message 5 of 7

choshQT24J
Enthusiast
Enthusiast

Yes, I have done that manually.
And I have made the family to check with "Cut with voids when loaded".
Maybe I need to provide my family file. I'll prepare for that.

0 Likes
Message 6 of 7

TripleM-Dev.net
Advisor
Advisor
Accepted solution

Hi @choshQT24J,

 

Seems a (old) post of @jeremytammik might be the answer: Transaction Group and Regeneration for InstanceVoidCutUtils 

 

The error message is shown when "Cut with Voids when loaded" isn't checked, but the error is also displayed if the family is placed and Cut without using a Commit between the 2 actions.

So follow this Setup:

1. Start a Transaction Group

2. Start a Transaction

3. Place all Families (including the VoidCut families)

4. Commit and end Transaction of 2.

5. Start a new transaction

6. perform the Cut actions

7. Commit and end transaction of 5.

8. Assimilate (and end) the Transaction Group

 

- Michel.

Message 7 of 7

choshQT24J
Enthusiast
Enthusiast

Thanks! I'll take a look on it.