[quote user="Jon Summers"]void AssociativePoint::InitOrigin (AssocPoint& assocPoint, UShort option );[/quote]
This method is analogous to the MDL C function mdlAssoc_createOrigin and its respective documentation; where the option integer value represents the Justification Point (0-default, or: 1 thru 9-origin points being;: LL, UL, UR, LR, CL, UC, CR, LC, CC) and can be used for element types: cell headers, shared cells, text nodes and text elements.
[quote user="Jon Summers"]void AssociativePoint::InitKeypoint ( AssocPoint & assocPoint, UShort vertex, UShort nVertex, UShort numerator, UShort divisor ) [/quote]
This method is analogous to the MDL C function mdlAssoc_createKeypoint and its respective documentation.can be used for Linear element types: lines, line strings and shapes. An association point can be placed directly on a specific vertex index (nVertex). Other times it is desired to calculate an association point to a projected (divisor) segment (numerator) between 2 specific vertices (e.g. Create association point between vertex 2 and 3, but projected 2/3 the distance of that segment). Is functionally similar to how MicroStation users set the keypoint snap divisor (ky=3, then snap on a segment project at points 1/3, 2/3, and 3/3 divisor points)
[quote user="Jon Summers"]When user selects a shape element, I want to construct an AssocPoint in the _OnDataButton event. What's a good way to do that?[/quote]
You will need to call InitKeypoint with your generic vertex/segment parameters as per above, then associate to the (root) element by calling SetRoot; something like:
switch (targetElementType) { case LINE_ELM: case LINE_STRING_ELM: case SHAPE_ELM: {
AssociativePoint::InitKeypoint (assocPoint, vertex, nVertex, numerator, divisor);
AssociativePoint::SetRoot(assocPoint, targetId, 0, 0);
break; }
HTH,
Bob