Community

[FREngine 11] Change Other Block to TextBlock

how can i change block type to FREngine.BlockTypeEnum.BT_Text

e.i if i have a table block i want to change it during runtime to a text block.

thanks

0

Comments

4 comments

  • Avatar
    SDK_support

    Please use IBlock::Type property for this. For more information see Help → API Reference → Layout-Related Objects → Block. Please note that this property is a read-only, for information about how to work with such properties, please see Help → Guided Tour → Advanced Techniques → Working with Properties.

    0
  • Avatar
    vbknight

    block type is defined at the creation and cannot be changed. You can only change it by deleting the block and replacing it with the correct type.

    0
  • Avatar
    SDK_support

    Yes, just copy the region of the block you need to replace to another Region object with the help of the IRegion::CopyFrom method, then delete the old block from the layout by calling the ILayoutBlocks::DeleteAt method and finally create a new block of the desired type and add it into the desired layout by calling the AddNew method of the Layout object.

    0
  • Avatar
    Antonio

    Sorry ... but If I create a new button in the Toolbar: - I can insert ourselves the code to invoke the Command that turns a block of type picture of a block of type text; - Make a loop on all the blocks in the document and save the file in a text contained in the blocks through education GetAsTextBlock.

    I think it is the principle on which is based the previous comment!

    0

Please sign in to leave a comment.