Revit 2023 PromptForFamilyInstancePlacement face based and workplane placement

Revit 2023 PromptForFamilyInstancePlacement face based and workplane placement

chas.barrott
Contributor Contributor
369 Views
1 Reply
Message 1 of 2

Revit 2023 PromptForFamilyInstancePlacement face based and workplane placement

chas.barrott
Contributor
Contributor

I made a plugin where items are loaded into a family to be able to place on a face selected by the user.  In Revit versions previous to 2023 the instance placement would always default to place on face instead of place on workplane which worked perfect for us. Now in Revit 2023 the instance placement always reverts back to the last placement option, which may have been place on workplane.  When the PromptForFamilyInstancePlacement method is run there is no way to select place on face before placing the object.  Is there a way with API to force Revit to always place on face instead of the last placement option that was used? Very frustrating for our plugin development when Revit changes the way it works in newer versions.

0 Likes
Accepted solutions (1)
370 Views
1 Reply
Reply (1)
Message 2 of 2

chas.barrott
Contributor
Contributor
Accepted solution

...so I managed to figure it out. You can add PromptForFamilyInstancePlacementOptions and use PlaceOnFace.

 

// troubleshoot placement option
PromptForFamilyInstancePlacementOptions placementOptions = new PromptForFamilyInstancePlacementOptions();
placementOptions.FaceBasedPlacementType = FaceBasedPlacementType.PlaceOnFace;

try
{
uidoc.PromptForFamilyInstancePlacement(fs, placementOptions);
}
catch (Autodesk.Revit.Exceptions.OperationCanceledException)
{
return Result.Cancelled;
}

0 Likes