Hi,
Im trying to remap the edit sketch command for revision clouds to my own implementation.
Im able to get the RevitCommandId by using:
RevitCommandId.LookupCommandId()
I create the AddinCommandBinding, but the events that I subscribe to are never raised.
Is there something Im missing here? You cant bind to Edit Sketch?
Thanks
Erik
Also, everytime the CanExecute event is raised, revit exits unexpectedly. Eventhough there is no code in the called method.
Doesnt matter if the debugger is attached or not.
Dear Erik,
Thank you for your report.
I would like to pass it on to the development team for further analysis and comment.
In order to do so, we require a complete reproducible case including a minimal sample model, minimal Revit API macro code to reproduce the issue, an exact description of the expected versus the observed behaviour, and detailed step-by-step instructions how to drive it:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Thank you!
Best regards,
Jeremy
Dear Erik,
Thank you very much!
Yes please.
That is what the development team prefer, since they have no C# add-in development environment set up.
Cheers,
Jeremy
Okey I've setup an testfile with a document macro. Its attached to this post.
By the way Jeremy, did you rename the forum post?
I have not tested anything with edit sketch on ceilings, only on revision clouds.
However judging from the name of the command (" Dialog_Essentials_SketchEdit:Control_Essentials_EditSketch ") it looks like it could be the same command though...
/Erik
Dear Erik,
Thank you very much!
What forum post do you mean?
I cannot rename or change the title or description of threads here in the Revit API forum, if that is what you mean.
You must have clicked something unintentionally when you initially started this thread.
That happened to me once too...
What would you like the description to be, please?
Maybe that will help understand your issue better...
Just for the sake of completeness and to enable search engines to find this thread more easily, here is the macro source code you provided:
public void RegisterAddinCommandBinding() { // I Have found two different command ids that look // promising. // This one: IDR_SKETCH_OBJECTS_REVISION_CLOUD does // not raise any events that I can see. // It does not return null though. //var revitCommandId = RevitCommandId.LookupCommandId( // "IDR_SKETCH_OBJECTS_REVISION_CLOUD"); // This will raise the CanExecute event. // But that is it. It also crashes Revit if you // debug it in Visual Studio after the event // handler returns. var revitCommandId = RevitCommandId.LookupCommandId( "Dialog_Essentials_SketchEdit:Control_Essentials_EditSketch"); var binding = this.Application.CreateAddInCommandBinding( revitCommandId); binding.BeforeExecuted+=Binding_BeforeExecuted; binding.Executed+=Binding_Executed; binding.CanExecute+= Binding_CanExecute; } private void Binding_Executed( object sender, Autodesk.Revit.UI.Events.ExecutedEventArgs e) { } private void Binding_BeforeExecuted( object sender, Autodesk.Revit.UI.Events.BeforeExecutedEventArgs e) { } private void Binding_CanExecute( object sender, Autodesk.Revit.UI.Events.CanExecuteEventArgs e) { }
I logged the issue REVIT-99920 [CreateAddInCommandBinding with SketchEdit crashes Revit] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.
You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.
This issue is important to me. What can I do to help?
This issue needs to be assessed by our engineering team, and prioritised against all of the other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:
This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.
Cheers,
Jeremy
Can't find what you're looking for? Ask the community or share your knowledge.