private static MDesign_BlockPreview MDesign_BlockPreview(BlockComponent blockComponent, int size) { if (blockComponent == null) { throw new ArgumentNullException(nameof(blockComponent)); } var blockSize = new Dimension(12, DimensionUnits.Inch); var scale = new DimensionScale(blockSize.Value, blockSize.Unit, size, DimensionUnits.Pixel); var pageLayout = new PageLayoutNode(blockSize * scale, blockSize * scale); pageLayout.LayoutSites[0].Node = blockComponent.Expand(false); pageLayout.UpdateBounds(PathOrientation.CreateDefault(), scale); var result = new MDesign_BlockPreview() { Width = (int)(blockSize * scale).Value, Height = (int)(blockSize * scale).Value, Shapes = MDesign_Shapes(pageLayout) }; return(result); }