0

In AutoLisp, the (getpoint....) utility offers an additional point variable argument which allows a new point variable to be relative from an existing point. The form is (getpoint RefPt "Next Point Where?"). How do I invoke the same methodology in Revit using C#?

//I have used the following code to invoke various snaps
//But none of the ObjectSnapTypes seemed to offer a reference point

ObjectSnapTypes Snapper = ObjectSnapTypes.Intersections | ObjectSnapTypes.Midpoints | ObjectSnapTypes.Endpoints;
XYZ CopyFrom = uiDoc.Selection.PickPoint(Snapper, "Copy From Where?");
Snapper = ObjectSnapTypes.Perpendicular | ObjectSnapTypes.Midpoints | ObjectSnapTypes.Intersections | ObjectSnapTypes.Endpoints;
XYZ CopyTo = uiDoc.Selection.PickPoint(Snapper, "Copy To Where");
//is there any way to get this "Copy To Where" to drag a vector with angle and distance?
//similar to the vector offered during Revit's "Copy" command?
XYZ porgy = CopyTo - CopyFrom;

1 Answers1

0

The Revit API PickPoint method does not support the rubber-banding provided by AutoLISP getpoint, cf.

http://www.revitapidocs.com/2017/a1d40214-13d6-2e11-36bb-905d49105168.htm

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • I knew that PickPoint didn't do it, but it is obviously possible since it appears during Revit's Copy/Move (in which the user is prompted for a "Copy From" point, and then shown a vector rubber-band for the "Copy To" point. I suppose I can insert a little Detail Item (just a circle) at the "CopyFrom" point, and invoke Revit's "Move" command, and then extract my "CopyTo" point from the resulting location. That just seems excessive to do something they have coded into Copy/Move – KeachyPeenReturns Apr 20 '17 at 12:29