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;
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;
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.
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.
Thank you so much for your quick response
Thank you so much for your quick response
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.
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.
Edited and saved for posterity:
Mille grazie, Maarten!
Edited and saved for posterity:
Mille grazie, Maarten!
Can't find what you're looking for? Ask the community or share your knowledge.