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

Fetching mouse coordinates on canvas

4 REPLIES 4
Reply
Message 1 of 5
felix.bausemer
720 Views, 4 Replies

Fetching mouse coordinates on canvas

Hello everybody,

 

I would like to ask if there is an option to retrieve the current mouse coordinates while hovering over the Revit canvas via API. I am working on an external application which allows to draw cable tray elements etc. The problem is that I would like to show the preview of my cable tray to be built while I am looking for the location of the end point. Also I would like to show the measurement from the start point to the current mouse cursor position. Is there a way to trigger a canvas event for retrieving the required coordinates?Modifier.PNG

Thanks in advance.

Labels (1)
4 REPLIES 4
Message 2 of 5

Instead of a mouse, try a Golden Retriever. They 'fetch'  pretty well.

 

Ba-dum tss

 

Joking aside, are you not able to see the Cable Tray and Temporary Dimensions as you sketch it?  

 

 

Message 3 of 5

Thanks for your reply 🙂

 

Unfortunately not. I am creating the cable trays by picking the endpoints via "UIDocument.Selection.PickPoint()". Of course the API does not recognize my intention of drawing a line by doing so. From my point of view there are two options: 

1. A better approach to create the cable trays from my external application (which I don't know yet :-))

2. Apply the temporary representation of the cable tray and dimensions by API

 

Or do you have maybe a better approach?

 

Message 4 of 5

Out of curiosity, what's this "external application" you're referring to?   

Message 5 of 5

It's a WPF form which is called by the Revit API in order to provide some product data. It also provides the possibility to select and create these products directly from this form. 

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report