Select wall face from point

hi @c.poupin,

Need to place the wall based electrical receptacles in the electrical file from the architectural model. but I am having the Location Only, since in Architectural file its work plane based. I need to get the nearest wall face.

Kindly Advice me.

From the FamilyInstance.Location how can I get the nearest wall face?.

Thanks & Regards,
SP Dhilip Seshan.FamilyInstance By Face.dyn (11.2 KB) link architectural file R20.rvt (1.4 MB) working electrical file R20.rvt (3.0 MB)

Hello @dhilipseshan

Your request is quite complex.

Here are some steps that will get you started:

  • collect the walls of the linked model
  • get the boundingBoxes of these walls (with an offset)
  • check for each instance of Families if it is in the boundingBox
  • if so, find the wall and the closest surface with the DistanceTo () or Face.Project () method (geometry of Faces to extract)
  • define the point on the surface
  • create a reference (in the host model) from the Face in the linked model
  • create the instance following an orientation to be defined

Added to this is the management of transformations if the models are not aligned.

Gentle reminder how to ask help on forum

1 Like