.NET

Reply
Active Contributor
RichardCammeray
Posts: 47
Registered: ‎12-08-2010
Message 1 of 7 (1,114 Views)
Accepted Solution

Add new grip point with GripOverrule

1114 Views, 6 Replies
10-18-2012 03:16 PM

Hi,

Before I will explore Grip Overrule world I have one question.

Is it possible to add new grip points into Entity?

 

 

Thank you,

Richard.

Valued Mentor
jeff
Posts: 327
Registered: ‎05-12-2009
Message 2 of 7 (1,108 Views)

Re: Add new grip point with GripOverrule

10-18-2012 04:10 PM in reply to: RichardCammeray

Yes

You can also find your answers @ TheSwamp
Active Contributor
RichardCammeray
Posts: 47
Registered: ‎12-08-2010
Message 3 of 7 (1,044 Views)

Re: Add new grip point with GripOverrule

11-06-2012 02:51 AM in reply to: jeff
Finally I have finished my grip overrule with success but I have one question (there are not many examples for grip overrule on the net).
Below is described what I did
 
1)Use grip overrule for BlockReference with subentities Lines and DBText (form a pair)
2)Use GetGripPoints to draw grips at each Line starting point.
3)Inside MoveGripPointAt is called my method which is moving pair of Line and Text in BlockTableRecord of overruled BlockReference
 
My worry is that with grip point selected with each mouse move BlockTableRecord is modified. Surprisingly its is working but I'm not very happy with that.
Should I use Subentity overrule if so I could not find any examples.
 
Thanks,
Richard
ADN Support Specialist
Balaji_Ram
Posts: 692
Registered: ‎03-21-2011
Message 4 of 7 (1,010 Views)

Re: Add new grip point with GripOverrule

11-09-2012 09:31 AM in reply to: RichardCammeray

Hi Richard,

 

Here is a sample on GripOverrule by Stephen Preston :

http://adndevblog.typepad.com/autocad/2012/05/draw-overrule-and-grip-overrule-sample.html

 

The problem that you are having now is not clear to me. What do you mean by "grip point selected with each mouse move BlockTableRecord is modified" ?

 

Can you please provide a simple buildable project to reproduce the problem ?

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Active Contributor
RichardCammeray
Posts: 47
Registered: ‎12-08-2010
Message 5 of 7 (984 Views)

Re: Add new grip point with GripOverrule

11-11-2012 06:50 PM in reply to: Balaji_Ram

Hi Balaji,

 

I have used for my project a sample found in Kean’s  blog but also learn from Stephen samples.

http://through-the-interface.typepad.com/through_the_interface/2012/09/overriding-the-grips-of-an-au....

 

I have written  a code as simpler as possible for  you just to show you my approach how to modify BlockReference (and its BlockTableRecord) by using grip overrule.

Attached is BlockRefGrip.txt and Test.dwg with block MYTESTBLOCK. There is only one line and one text in the block. If you run GOO command you should be able to modify position of line and text of the block by grip point at line starting point.

This code works (in my machine), but I do not like the point in  MoveGripPointsAt() method where MoveLineAndText() method is called to relocate line and text. If I understood it correctly this method is fired by every mouse move of grip point.

Is my  approach of editing BlockReference(and its BlockTableRecord) by grip overrule correct?

 

For simplicity I did not include in attached sample handling situation if user abort grip point or  use UNDO command.

 

Thank you,

Richard

ADN Support Specialist
Balaji_Ram
Posts: 692
Registered: ‎03-21-2011
Message 6 of 7 (926 Views)

Re: Add new grip point with GripOverrule

11-20-2012 12:24 AM in reply to: RichardCammeray

Hi Richard,

 

Sorry for the delay. I got engaged with other activities last week.

 

I tried the sample project that you had shared.

 

Inside the "MoveGripPointsAt" method, you do have to modify the entity based on the offset vector. In Stephen's sample that I was referring to in my previous reply, the "MoveWorker" method modifies the entity.

 

The entity in your sample project is a block reference so you should be using the offset vector to do some transformation on the block reference and not the block table record as the sample seems to be doing.

 

Although modifying the block table record using the grip will work, the changes would also affect other block references that refer to this block table record. You may have some good reason for modifying the block table record this way but please note that the grip are meant for entity level transformations.



Balaji
Developer Technical Services
Autodesk Developer Network

Active Contributor
RichardCammeray
Posts: 47
Registered: ‎12-08-2010
Message 7 of 7 (899 Views)

Re: Add new grip point with GripOverrule

11-26-2012 02:35 PM in reply to: Balaji_Ram

Hi Balaji,

 

Thank you for your advice.

Yes you are right, any changes in block table record will affect other block references, so one part of my code ensures that block table record has only one reference.

My code mimics creating of the custom object  the way that it creates anonymous block.

I was just curious if it is possible to use grip overrule to modify this block reference via its block table record (surprisingly it works but there are some downsides), but as you said, grip overrule is meant for entity level.

 

Thank you,

Richard

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.