Place a host-based element on a specific face of a wall

Place a host-based element on a specific face of a wall

heziTYJKR
Contributor Contributor
224 Views
0 Replies
Message 1 of 1

Place a host-based element on a specific face of a wall

heziTYJKR
Contributor
Contributor

Hi all,

I am struggling with an issue for a long time now.

We have some host-based (FamilyPlacementType.OneLevelBasedHosted to be specific) that we need to place on a specific face of a wall.

I tried using all the methods that get a face or a reference to a face but they failed because of the family's placement type:

NewFamilyInstance(Face, XYZ, XYZ, FamilySymbol)

NewFamilyInstance(Reference, XYZ, XYZ, FamilySymbol)

 

I tried using the following method with a direction but it seems not to work:

NewFamilyInstance(XYZ, FamilySymbol, XYZ, Element, StructuralType) 

 

The interesting part is that I can place the family manually and it can be placed on the side that I desire.

This is how this family works when I place it manually:

heziTYJKR_0-1661665859361.png

And when I try to place it with the API, it is placed in the opposite direction (the lower one):

heziTYJKR_1-1661666138606.png

This is the code I used:

XYZ direction = new XYZ(0,1,0);//I tried all kinds of directions
FamilyInstance instance = doc.Create.NewFamilyInstance(new XYZ(65.5280909618585, 27.0970624218628, 5.10416666666668), voidFamilySymbol, direction, wall, StructuralType.NonStructural);

 

When I place it manually vs API, I see the following difference between the families:

The family that was placed manually:

heziTYJKR_2-1661666432787.png

 

The family that was placed via the API:

heziTYJKR_3-1661666488907.png

I tried to flip them but it is not allowed and the operation fails.

 

Any idea on how to fix that?

Thanks!

225 Views
0 Replies
Replies (0)