在 Word 页面中最大化图像的 M2DOC Eclipse Capella 命令是什么?
What is the M2DOC Eclipse Capella command to maximize an image in a Word page?
在 Word 页面中最大化图像的 M2DOC Eclipse Capella 命令是什么?
我试试这个代码:
{m:for rep | lc.representationByDescriptionName('Logical Architecture Blank')}
{m:if rep.getHeight() > rep.getWidth()}
{m:rep.asImage().setHeight(600)}
{m:else}
{m:rep.asImage().setWidth(400)}
{m:endif}
但是给我这个错误:
{m:if rep.getHeight() >= rep.getWidth()} Invalid if statement: Couldn't find the 'getHeight(org.eclipse.sirius.viewpoint.DRepresentation)' serviceInvalid if statement: Couldn't find the 'getWidth(org.eclipse.sirius.viewpoint.DRepresentation)' serviceInvalid if statement: The predicate never evaluates to a boolean type ([]).
但是我已经插入了所有的 sirius 包 uri。
非常感谢!
您正在使用 DRepresentation 调用服务 getHeight(),您应该在 MImage 上调用它:
rep.asImage().getHeight()
但是为了优化,你可以使用一个let:
{m:for rep | lc.representationByDescriptionName('Logical Architecture Blank')}
{m:let image = rep.asImage()}
{m:if image.getHeight() > image.getWidth()}
{m:image.setHeight(600)}
{m:else}
{m:image.setWidth(400)}
{m:endif}
{m:endlet}
{m:endfor}
在 Word 页面中最大化图像的 M2DOC Eclipse Capella 命令是什么?
我试试这个代码:
{m:for rep | lc.representationByDescriptionName('Logical Architecture Blank')}
{m:if rep.getHeight() > rep.getWidth()}
{m:rep.asImage().setHeight(600)}
{m:else}
{m:rep.asImage().setWidth(400)}
{m:endif}
但是给我这个错误:
{m:if rep.getHeight() >= rep.getWidth()} Invalid if statement: Couldn't find the 'getHeight(org.eclipse.sirius.viewpoint.DRepresentation)' serviceInvalid if statement: Couldn't find the 'getWidth(org.eclipse.sirius.viewpoint.DRepresentation)' serviceInvalid if statement: The predicate never evaluates to a boolean type ([]).
但是我已经插入了所有的 sirius 包 uri。
非常感谢!
您正在使用 DRepresentation 调用服务 getHeight(),您应该在 MImage 上调用它:
rep.asImage().getHeight()
但是为了优化,你可以使用一个let:
{m:for rep | lc.representationByDescriptionName('Logical Architecture Blank')}
{m:let image = rep.asImage()}
{m:if image.getHeight() > image.getWidth()}
{m:image.setHeight(600)}
{m:else}
{m:image.setWidth(400)}
{m:endif}
{m:endlet}
{m:endfor}