do something when a command is active

do something when a command is active

Joris.vd.Meulen
Collaborator Collaborator
502 Views
3 Replies
Message 1 of 4

do something when a command is active

Joris.vd.Meulen
Collaborator
Collaborator

Hi,

 

Is there an option in api that allows us to do something when another command is active?

 

For instance:

I click on wall command and like to manually override the first pickpoint with my command/script.
That script of mine returns a calculated point, but this script can't be launched / button is greyed out.

 

Am I right to state that this behaviour (run script while other command is active) is not possible?
(Right click, snap overrides is possible, that behaviour can be mimicked?)

love python coding
0 Likes
503 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

I don't know whether it is completely impossible; almost nothing is. It is probably extremely tricky, in any case, due to the single threaded nature of Revit and the restriction of the API to a valid API context, also running in the single thread.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

Sean_Page
Collaborator
Collaborator

You could look at Command Binding, but if you already know one point because it's calculated, then why not just create a command that has the user pick the end point and then create the wall programmatically?

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
Message 4 of 4

Joris.vd.Meulen
Collaborator
Collaborator

@Sean_Page because I'd like to create a multipurpose command, so it's not related to one command.

 

My simple scripts

asks for a base point

asks for two points

returns the midpoint of two user given points. 

 

I'd like to use this script as I'm creating a wall, as I'm copying a piece of furniture, as I'm moving a curtain wall. 

(at the moment I run this script based upon a selection, but that is an extra step)

 

But as @jeremytammik mentioned, I too stumbled upon some limitations. Perhaps I'm wrong?

 

 

love python coding
0 Likes