I want to place a sleeve family centered on a duct nearest where I click on it. Often walls are not modeled properly or full height so I can’t rely on those for an intersecting location.
I know how to get the center line of the duct and place the model element on it centered, but I’m not sure how to use a point along the center line nearest where I click on screen.
Why click? You can always include a UI to select the element(s) and use that; point and click is usually unreliable.
That being said, why not just find a way to filter the elements? How are you identifying which ducts needs a sleeve and which don’t? Seems easier to build in logic that identifies these ducts for you and removes the need to manually “click”.
The closest you’ll get in dynamo is “Select Point on Face”. From there you can either detect which element is selected (but this is sort of computationally expensive) or include another selection for the element you want to target.
I could place sleeves anywhere duct intersects a linked wall, but we would miss ones where the wall isn’t modeled at the proper height.
It tends to be better to just select the duct and have a sleeve placed on it centered and adjust size automatically. I would like the sleeve to place along the length of the duct near where the user clicks. then adjust it location as needed.
Could you just project the wall geometry upwards by a given amount? By manually identifying and clicking each duct location to place a sleeve you’re really not automating much. At that point why not just use a duct hosted family that would place where you click? There will always be edge cases and a need for manual confirmation with an automated approach, but it’s almost always worth the effort to automate around a “correctly modeled” condition than an incorrect one (or at least with a few common fixes).
Select the wall with one UI. Select the pipe with another UI. Get the location of each. Pull the wall location curve onto the plane of the pipe curve with a Curve.PullOntoPlane node. Then intersect the two with a Geometry.Intersect node - now you have your point!