.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catch Dynamic Block Visibility Change Event

3 REPLIES 3
Reply
Message 1 of 4
Hugh_Compton
600 Views, 3 Replies

Catch Dynamic Block Visibility Change Event

 

Does anyone know how to catch the end of the Dynamic Block Visibility change event?  Since this isn't a command I'm a bit foxed.

3 REPLIES 3
Message 2 of 4
norman.yuan
in reply to: Hugh_Compton

manupulating dynamic block by user (dragging/clicking grips) certainly triggers events that can be handled with .NET API.

 

You can write some code handle Documnet.CommandWillStart/CommandEnded, something like:

 

    Editor.WriteMessage("\nCurrentCommand is: {0}.", e.GlobalCommandName);

 

and then munipulate a dynamic block iin a drawing to verify the code in the 2 event handlers running. You should see that the implicit command triggered when you drag/click a dynamic block's grip is either "GRIP_POPUP" or "GRIP_STRETCH".

 

I am not sure your purpose of catching these events, but it is likely that you need to start from handling these 2 events and filter out specific command name (GRIP_POPUP and GRIP_STRETCH, and maybe others), and then incorporate with other event handlers (such as Database.ObjectModified...), to eventually be able to do something meaningful.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4
Hugh_Compton
in reply to: Hugh_Compton

 

Thanks Norman, you pointed me in the right direction. 

 

I had to give up in the end though since I wasn't sure if the 'overhead' was worth the gains.  It was a routine to grab the information of the visible entites in a dynamic block and add that information to the dynamic block itself.  This works with a command reactor on the Save Event but not the dynamic Block change event.  i bacame a bit "tangled" with code that I didn't fully understand...!

Message 4 of 4
norman.yuan
in reply to: Hugh_Compton

Additional information, although you may have decided not pursuing this route:

 

I have an article on handling dynamic block property being changed. Although it is about a "stretch" dynamic property, the logic of algrithm would be the same or very similar. I forgot to mention it in my previous reply. Here is the link, just in case you have not seen it or it may be of help:

 

 http://drive-cad-with-code.blogspot.ca/2013/11/a-block-with-auto-pointing-leader.html

 

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost