Transaction without lock active view

Transaction without lock active view

phongthehuynh95
Contributor Contributor
624 Views
6 Replies
Message 1 of 7

Transaction without lock active view

phongthehuynh95
Contributor
Contributor

When i do transaction, its always lock active view, i cant do anything like: rotate, zoom in, zoom out and see how it changes like the following link. So, how i can do like that?

Appreciate for any comments.

Regards

 

https://www.youtube.com/watch?v=p1mD3QzW7pA

 

0 Likes
625 Views
6 Replies
Replies (6)
Message 2 of 7

IbrahimNaeem
Advocate
Advocate

your windows form should be modeless means it should be showed using 

WindowsForm.Show();

 not 

WindowsForm.ShowDialog();

Note that in the modeless dialogs, it will still show even after the external command is ended and in that case your dialog will not have an access to the API as the external command has finished its work. 

 

Thanks, Ibrahim Naeem 

 

0 Likes
Message 3 of 7

phongthehuynh95
Contributor
Contributor

its not about the form. My problem is when i start transaction, i cant do anything with the model like zoom in, zoom out, select model or rotate it until transaction finish. In the link i posted, he can rotate model and see how it changes. 

Anyway, thanks for your reply

0 Likes
Message 4 of 7

IbrahimNaeem
Advocate
Advocate

I talked about forms because the video you shared contains winforms. What's shown in the youtube video isn't one transaction or else he wouldn't be able to zoom or rotate around the model like he's doing in between creation of walls. These are subtransactions within a foreach and sure between subtransactions you can rotate and pan the model. Even within the main transaction you can do so if you didn't already commit the transaction because committing the transaction makes revit busy doing what's scheduled within that transaction . Notice that the creation of walls are really slow and perhaps he's using something like Thread.Sleep(1000); so he can have a chance to rotate around the model while creation is in progress, "just for show reasons I believe" 

 

Thanks, Ibrahim Naeem 

 

0 Likes
Message 5 of 7

phongthehuynh95
Contributor
Contributor

I had tried using transaction group + transaction and transaction + subtransaction and it doesnt work. It seems like when you start command, it do not allow you to do any effect on your model until it finish. Even when i use thread.sleep() as your suggest, its still not working Man Sad

0 Likes
Message 6 of 7

IbrahimNaeem
Advocate
Advocate

I myself Used one main transaction here and do the pipe per pipe transaction as sub-transaction from the dialog I'm showing. I let Revit calling a selection in the main transaction so I always have an access to the model to zoom, rotate and pan. 

https://www.youtube.com/watch?v=oWEzy-XtU8k&t=17s 

 

Thanks, Ibrahim Naeem 

0 Likes
Message 7 of 7

ottosson_mathias
Advocate
Advocate

Interesting approach. Would you mind sharing a code snippet to show how you did that? I can't quite understand how you solved it just from your explanation.

 

Thanks!

0 Likes