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 26, 2023

ok, then it seems kAutoFlowCmdBoss is the correct command.

 

You need to now check with my point no. 2.


Sorry but i have no idea of how to do an observer, do you have advice or some example from which I can take inspiration.

Stefano