Need Info When a New Shape is Dropped on the Drawing


Author
Message
Jason Irby
Jason Irby
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 59, Visits: 77

 

Hi,

I need a little help.  I have an app where I drag a shape from a Library Browser  onto a drawing.

What I need is:

·         To be able to get an event when that happens.

·         To get a reference to the new NDiagramElement created so that, based on its Name property, attach specific data to its Tag property.

·         To be able to know if it’s being dropped on an empty space on the document or on top of another NDiagramElement.  If the latter I need a reference to that underneath object to do some auto connecting logic (again depending on the Name and/or Tags of the shapes involved).

What I was initially looking for was something like a DrawingDocument_ShapeAdded event handler, but couldn’t find anything that obvious. 

I’ve tried the DrawingDocument_DrapDrop event handler with partial success.  I can cast args.HitNode to a Document or NDiagramElement to get what was dropped on.  However I don’t have a reference to the newly created shape.  At best, I’ve been able to get to args.Data.GetData("Library Data Object").Masters[0].Name.  But I need to get to the new object itself to attach custom data to the tag and do special connection logic.

Is there an easier approach I am missing?

 

Thanks in Advance,

Jason Irby

 

 

 

 

 

 

 

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search