Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

How can I draw the Detail Line to let the information of direction and angle emerge before finishing the command?

Anonymous

How can I draw the Detail Line to let the information of direction and angle emerge before finishing the command?

Anonymous
Not applicable

How can I draw the Detail Line to let the information of direction and angle emerge before finishing the command?

UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;

List<XYZ> listPoint = new List<XYZ>();
int i = 0;
while (true)
{
try
{
ObjectSnapTypes snapTypeA = ObjectSnapTypes.Endpoints | ObjectSnapTypes.Intersections;
XYZ A = uidoc.Selection.PickPoint(snapTypeA, "Select an end point or intersection");
listPoint.Add(A);
}
catch (Exception)

{
break;
}

i++;
}
using (Transaction tx = new Transaction(doc))
{
tx.Start("Create Detail Line");

for (int a = 0; a < listPoint.Count-1; a++)
{
Line geomLine = Line.CreateBound(listPoint[a], listPoint[a+1]);
DetailLine line = doc.Create.NewDetailCurve(view, geomLine) as DetailLine;
}

tx.Commit();
}
return Result.Succeeded;


Capture.PNGCapture2.PNG

0 Likes
Reply
702 Views
4 Replies
Replies (4)

jeremy_tammik
Autodesk
Autodesk

You could try to launch the built-in Revit command together with the built-in user interface by using PostCommand.

 

Another option might be to implement some kind of own jig, e.g., using the IDirectContext3DServer:

 

https://thebuildingcoder.typepad.com/blog/2020/10/onbox-directcontext-jig-and-no-cdn.html#3

 

Maybe you could also use some kind of Windows tooltip to display the required real-time information.

 

Unfortunately, since this functionality is not supported by the Revit API out of the box, I'm afraid it will be very hard indeed to implement anything that is both useful and nice to use.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

Anonymous
Not applicable

Thank you so much for your quick response

MvL_WAG
Contributor
Contributor

In one of my command I actually use a linebased detail item in combination with PromptForFamilyInstancePlacement() to mimic that kind of behavior. 

 

The command is used to rotate a the cropregion of planview.

I have added a video of the functionality.

 

jeremy_tammik
Autodesk
Autodesk

Edited and saved for posterity:

  

https://thebuildingcoder.typepad.com/blog/2021/05/refreshment-cloud-model-path-angle-and-direction.h...

  

Mille grazie, Maarten!

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes