Insert Block by 3 Points with "live preview" like "Orient3Pt" possible?

Hi,

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.

1 Like

Hi @tobias.stoltmann,

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).

For an example of it’s usage, see this:

https://mcneel.myjetbrains.com/youtrack/issue/RH-66855

– Dale

3 Likes

Hi @dale,
sounds very good to me. :slight_smile:
So I will wait a few weeks, give it a try then and give you an update.
Thanks a lot (as always).

T.

RH-66855 is fixed in Rhino 7 Service Release 15 Release Candidate