Unanchored Frames within a element

New Here ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

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.

marlon22693430lmio_0-1647531542694.png

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. 

Unbenannt.PNG

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 

Marlon

 

TOPICS
Scripting , Structured

Views

43

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Mar 17, 2022 Mar 17, 2022
For the 2nd approach the solution is to do this via the "Object" propertie:var inset = graphic.Object.FirstGraphicInFrame;"graphic" is the Graphic element.  

Likes

Translate

Translate
New Here ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

LATEST

For the 2nd approach the solution is to do this via the "Object" propertie:

var inset = graphic.Object.FirstGraphicInFrame;

"graphic" is the Graphic element.  

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines