How to create Rubber band line in Revit API

How to create Rubber band line in Revit API

kite15
Advocate Advocate
804 Views
3 Replies
Message 1 of 4

How to create Rubber band line in Revit API

kite15
Advocate
Advocate

Hi,

I have seen an option available to create a rubber band line in AutoCAD API development.

As an Example:

 PromptPointOptions pPtops1 = new PromptPointOptions("");
// Prompt for the first point
pPtops1.Message = "\nSpecify first point : ";
 pPtRes1 = acDoc.Editor.GetPoint(pPtops1);
 pPtops1.Message = "\nSpecify second point : ";
// Use the previous point as the base point
pPtops1.UseBasePoint = true;
pPtops1.BasePoint = pPtRes1.Value;
pPtRes2 = acDoc.Editor.GetPoint(pPtops1);
Point3d pnt2 = pPtRes2.Value;


 Since the first point can used as a base point with asking for the second point.

Can any one help. how it can by imply in Revit API development ?

 

Thanks in advance.

 

0 Likes
805 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

The official Revit API does not provide support for this.

 

If you wish to take the risk and hack a bit, here is a possible approach:

 

 

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

kite15
Advocate
Advocate

Thank you, Mr. Jeremy,

I have found a similar kind approach in this link.

Link: https://stackoverflow.com/questions/45140151/how-can-i-draw-a-rubber-band-line-while-picking-the-sec... 

 

However, the Revit application does not respond.

The said imaginary line should be displayed until the last point is confirmed.

RubberBandLine.png

 

Please, see the above snap for more understanding.

 

Thank you.

 

 

 

 

 

 

 

 

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

I recommend that you just stick with the official functionality provided by the Revit API... so no rubber banding... 

  

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