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

How to create Rubber band line in Revit API

kite15
Advocate

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
Reply
360 Views
3 Replies
Replies (3)

jeremy_tammik
Autodesk
Autodesk

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

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

jeremy_tammik
Autodesk
Autodesk

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