Get Element (Security Device) within Distance To Linked Element (Door) XYZ location

Hello All,

I am able to get the location point of doors from linked model. I would like to now get elements within a certain distance of the XYZ point of the door.

  1. Get Door Location from Linked model (done)
  2. How do I get the elements surrounding that point (unsure)ClosestToDoor.dyn (21.3 KB)

Not sure I am using the Tool.GetSurroundingElements and Geometry.DistanceTo correctly.

Any help in the correct direction is greatly appreciated…attached my attempts so far.

Two questions.

  1. Is your link transformed, meaning has it been rotated and therefore the points don’t correspond to where you think they should?
  2. Is the 12 (feet?) the correct units?

Also, could you show an image with the previews assuming you have elements in the category your looking for showing up.

Try something like this…

bb intersect.dyn (33.4 KB)

bb

2 Likes

Hey Sean,

  1. The link is using Shared Coordinates.
  2. I picked an arbitrary distance but the units are imperial.

Hi Gavin,
Thank you for the feedback. I tried the script and modified it somewhat. It created a cuboid around the point of the door…which i extended into the z-axis to intersect with the Security Devices. Is there a way to flatten it all?

Works good. gets me the door location and devices within distance of the door


1 Like

Ah that changes a lot. In that case I’d ignore the Z component and use surfaces and run a full intersection set over each door’s circular generated surface.

flattened.dyn (29.5 KB)

2 Likes

Gavin,
I think i need to get the door XY and security devices XY on the same plane to get intersection correct? Now i get 3 tiers of points.

I need to flatten to the same plane?

So in that case we flatten them to their respective level (assuming the door/outlet host levels are at the same level elevations).

flattened.dyn (39.3 KB)

1 Like