Skip to main content
Participant
January 10, 2008
Question

help me !!!!!!!!!!!!! how to use IAutoFlowCmdData?

  • January 10, 2008
  • 3 replies
  • 1698 views
I Want to auto flow xml file into indesign,
I find IAutoFlowCmdData,
but how can i use it????

help me, please!

thank u.
This topic has been closed for replies.

3 replies

Inspiring
July 31, 2023

Thanks to the patience and help of @Rahul_Rastogi, here's the correct answer.

 

ErrorCode AutoFlow(UIDRef pageItem, PMPoint attachPoint)
{
    ErrorCode result = kFailure;
    
    do{
        
        /// Page
        InterfacePtr<IPageList> pageList(DOCUMENT, UseDefaultIID());
        if(!pageList)
            break;
        UID UIDPage = pageList->GetNthPageUID(pageList->GetPageCount()-1);
        
        /// SpreadLayer
        InterfacePtr<IHierarchy> hierarchy(pageItem, UseDefaultIID());
        if(!hierarchy)
            break;
        UIDRef UIDRefspreadLayer(DATABASE, hierarchy->GetLayerUID());
        
        /// Fill PlaceGun
        if(Utils<Facade::IImportExportFacade>()->LoadPlaceGun(UIDList(pageItem), IPlaceGun::kAddToBack) != kSuccess)
            break;
        
        /// Autoflow Command
        InterfacePtr<ICommand> autoFlowCmd(CmdUtils::CreateCommand(kAutoFlowCmdBoss));
        InterfacePtr<IAutoFlowCmdData> autoFlowCmdData(autoFlowCmd, UseDefaultIID());
        autoFlowCmdData->Set(UIDPage, kInvalidUID, UIDRefspreadLayer, attachPoint, kFalse, kTrue);
        
        /// Execute the command
        result = CmdUtils::ProcessCommand(autoFlowCmd);
        
    }while(false);
    
    return result;
}

 

Inspiring
July 31, 2023

Great ! 🙂

 

Inspiring
July 21, 2023

I've got the same problem of @_m_momchilov_ .

Someone know how to resolve?

Stefano

Participant
June 12, 2008
I use the following code: <br /><br /> InterfacePtr<ICommand> autoFlowCmd(CmdUtils::CreateCommand(kAutoFlowCmdBoss)); <br /> if (!autoFlowCmd)<br /> {<br /> break;<br /> }<br /> InterfacePtr<IAutoFlowCmdData> iAutoFlowCmdData(autoFlowCmd, UseDefaultIID());<br /> ASSERT(iAutoFlowCmdData);<br /> if(!iAutoFlowCmdData)<br /> {<br /> break;<br /> }<br />InterfacePtr<IHierarchy> iHierarchy(pDB , boxUID , UseDefaultIID());<br /> if(!iHierarchy)<br /> {<br /> break;<br /> }<br />iAutoFlowCmdData->Set(pageUID , boxUID , UIDRef(pDB , iHierarchy->GetLayerUID()) , PMPoint(0,0));<br /><br /> if(CmdUtils::ProcessCommand(autoFlowCmd) != kSuccess)<br /> {<br /> ErrorUtils::PMSetGlobalErrorCode(kSuccess, kFalse);<br /> break;<br /> }<br /><br />But i get crash when execute the command.<br />I can't find any samples into the internet and the into adobe helps!?<br />Can someone help with advice?
Inspiring
July 21, 2023

IAutoFlowCmdData->Set(UID page, UID frameList, UIDRef &parent....

 

Are you passing the 2nd parameter correct - I hope you are not passing Frame's UID (boxUID) but instead passing the UID of kFrameListBoss.

 

InterfacePtr<IGraphicFrameData> iGraphicFrameData(frameUIDRef, UseDefaultIID());

InterfacePtr<IMultiColumnTextFrame> imcf(iGraphicFrameData->QueryMCTextFrame());

 

UID frameListUID = imcf->GetFrameListUID();

 

pass the above frameListUID.

 

- Rahul Rastogi

Adobe InDesign C++ Plugins Solution Architect

Inspiring
July 25, 2023

This requires investigation.

 

I don't have the InDesign Debug build installed otherwise we need to know the following -

 

From Debug build -

1. Capture command kAutoFlowCmdBoss

2. Do auto flow manually in InDesign and capture the command kAutoFlowCmdBoss

3. Check the contents of the interface IAutoFlowCmdData, IAutoFlowOversetText, ICommand->GetItemList.

 

Based on above findings we can then conclude what are the exact correct parameters the command is expecting.

 

 


Thanks for reply @Rahul_Rastogi,

I think this method is perfect and can save me a lot of time because, when command are not enogh documented, I usually fill interface and hope that it can works, how i'm doing now, and i ofted lose a lot of time doing this.

If you could tell me how I can capture a command you would be doing me a really big favor because I don't have a clue how to do it, I think I should use InDesign Debug, right?

Stefano