Author Topic: BlockJig : EntityJig but chaning base insertion point to node(s) point  (Read 3070 times)

0 Members and 1 Guest are viewing this topic.

dugk

  • Guest
I'm using the code from Kean's post (Jigging an AutoCAD block with attributes using .NET) http://through-the-interface.typepad.com/through_the_interface/2009/03/jigging-an-autocad-block-with-attributes-using-net.html but as the user drags the block I want to give them the option to switch between the node entity points in the block definition and use those points as the insertion base point.

I don't think want to modify the block definition's base point (correct me if that would work) so I'm trying to figure out how to modify the BlockJig to switch the insertion base point.

I've already got code working for prompting the user:
Code: [Select]
                JigPromptPointOptions opts = new JigPromptPointOptions(inserStr);
                opts.BasePoint = new Point3d(0, 0, 0);
                opts.UserInputControls = UserInputControls.NoZeroResponseAccepted;
                opts.AppendKeywordsToMessage = true;
                opts.Keywords.Add(nodeNext);

Now I just need help figuring out the "mechanics" of making it work.  If you have any suggestions it would be very much appreciated.

Thanks,
Doug

Bryco

  • Water Moccasin
  • Posts: 1883
Sounds like you want to start your insert jig, then if the user types the node open, insert the block at the cursor, allow the user to pick the node then use a move jig

dugk

  • Guest
I like your idea but actually inserting the block and then moving it could result in the user canceling the move portion and result in a block insert that they didn't actually intend to have.

I still think I need to better understand how the Entity Jig works better.

I know there are a lot of Entity Jig examples but I have not found one that is similar to this.

Here is a video from a different CAD program that does what I'm looking to duplicate in C# for AutoCAD:  http://screencast.com/t/MTgzZDQ4NGI

In that program once you have the Entity Jig started you can hit the spacebar and it then switches the Entity Jig insertion base point to the next node point in the block definition.  In the video I'm just iterating through the different block definition node points as I drag the block around.

Thanks for your suggestions!
Doug

dugk

  • Guest
Refer to this post for the code I used to answer this issue:  http://www.theswamp.org/index.php?topic=33483.msg389851#msg389851