Ask user to select insertion point with an illustration of the result

atir5UTNF
Advocate
Advocate

Ask user to select insertion point with an illustration of the result

atir5UTNF
Advocate
Advocate

I've created some detail items from the API, and I want to ask user to select an insertion point.

I want the draw a box or the the element I've created when the user moves the cursor, like Revit does when moving or adding a new element.

How can I achieve this behavior?

 

atir5UTNF_1-1719215644204.png

 

 

 

0 Likes
Reply
Accepted solutions (1)
152 Views
1 Reply
Reply (1)

jeremy_tammik
Autodesk
Autodesk
Accepted solution

That is a good idea. The Revit API does not add full support for this functionality, unfortunately. You can achieve something similar in two ways that I am aware of:

  

  • Prompt for family instance placement
  • Simulate a jig

  

The PromptForFamilyInstancePlacement and PostRequestForElementTypePlacement methods prompt the user to place instances of a specified FamilySymbol and display a preview of the placement using the built-in Revit family placement functionality:

  

  

However, they are asynchronous, so not wholly integrated into the add-in code.

  

A sketchier preview can be achieved by drawing some transient graphics of your own to simulate what is known in AutoCAD as a jig:

   

    

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