Hello,
How to know the currently edited InstanceDefinition during the BlockEdit command ?
Thank you, jmv
Hello,
How to know the currently edited InstanceDefinition during the BlockEdit command ?
Thank you, jmv
Hi @kitjmv
Do you mean how to edit it after adding it with InstanceDefinitions.Add?
Maybe you can catch the phrase that is sent to the commandline when editing the block?
Hello @jack3
No, when the user edits a block with the BlockEdit command.
During the BlockEdit command, we select the objects contained by the block (Mesh, Brep, …).
These objects are copies of the original.
Hello @Gijs
Yes, I have experienced things like that.
It can work for simple blocks.
But when the block contains other blocks (which contain other blocks), it’s more complicated.
I can’t find any way to get information about the currently edited block.
Hi @kitjmv ,
In the Command.BeginCommand event, you could check if the command run has the name “BlockEdit”.
If it does, then get all the selected objects by RhinoDoc.Objects.GetSelectedObjects(), if the count is 1, then that’s the block under edit.
If count is 0, this means the block is not selected yet… so you flag a boolean that the “BlockEdit” command has started… And then watch the RhinoDoc.SelectObjects event, if your flagged boolean is true, and selected object is 1, then that is your block.
Hello @Darryl_Menezes ,
Well, it’s not that simple.
The BlockEdit command copies all the elements and changes their ID.
Also if as you say it is possible to know if the command has been called,
I haven’t found a solution for whether we have exited edit mode.
Thank you all.
I just found a brutal solution: