I was asking myself if it was possible to create a command to insert a block more conveniently.
I wanna pick 3 points and they should define the plane the block gets inserted on.
So far I am capeable of this.
But in my eyes it would be very much more convenient if I could see how the position of the block looked like while inserting it. This would be equivalent to the way Orient3Pt works, where it’s super nice to be able to see the result while executing it and being able to correct the action possibly.
So far I think I understood how the Orient3Pt command works.
I guess everytime the position of the cursor get’s changed the view gets redrawn and the position of the cursor is evaulated, right? The plane at the at current position is evaluated and the objects are placed (“physically” in the model) and if this is not okay they get deleted or replaced with the new position chosen.
Is this assumption correct, or is there a better, maybe easier approach?
Thanks,
T.
Orient3Pt uses custom GetPoint-inherited classes that draw the transformed geometry dynamically. This is the recommended pattern, rather than the clunky delete/replace/redraw method.
For dynamically drawing instance definition, I’ve exposed a new DisplayPipeline.DrawInstanceDefinition that should make the dynamic drawing of blocks, during insertion, much easier. This new function will appears in SR15 (in a few weeks).
@brian@dale
I work on Rhino 7 SR15 2022-2-8 (Rhino 7, 7.15.22039.13001), but I am not able to run this.
It simply inserts the block on the chosen insert point, but gives no option to orient the block.
The issue resolved here (https://mcneel.myjetbrains.com/youtrack/issue/RH-66855) is to allow developers to dynamically draw instance definitions. It’s up to you to come up with the rest of the UI. So if you want to show an instance definition orienting, then you’ll need to compute the proper transformation and then pass this transform to DisplayPipeline.DrawInstanceDefinition.