Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

4 REPLIES 4
Reply
Message 1 of 5
doanvanquyet5120
422 Views, 4 Replies

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

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

4 REPLIES 4
Message 2 of 5

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
Message 3 of 5

Thank you so much for your quick response

Message 4 of 5
MvL_WAG
in reply to: doanvanquyet5120

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.

 

Message 5 of 5

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community