Hello FrameMaker community,
i'm currently struggeling to find a way, how to get graphics that are inside an element or get the parent element of a graphic. Given is the following structure:
The Graphic element contains an unachored frame with one or more graphics (XML-Output):
<GraphicContainer> <Graphic> <xy:Graphic file="xy.eps"> <fm:Frame> <fm:Inset/> </fm:Frame> </xy:Graphic> </Graphic> </GraphicContainer>
There are two options that I have for my usecase:
1. Select the frame and get the parent element.
I can receive the selected graphic, by executing the following function:
graphic = doc.FirstSelectedGraphicInDoc;
But i can't find a way to find out which element contains this frame/graphic.
2. Select the "GraphicContainer" in the structure tree and get all children graphics.
I've tried to receive the children frames by executing the following lines:
tr = doc.TextSelection; var ti = doc.GetTextForRange(tr, Constants.FTI_Frame);
But the received object (ti) is invalid.
Can anyone explain me, how framemaker handles graphics inside elements or give me an example?
Ty and best regards
For the 2nd approach the solution is to do this via the "Object" propertie:
var inset = graphic.Object.FirstGraphicInFrame;
"graphic" is the Graphic element.