Konstantin Seleznev on November 20, 2011 Is there any methods to output not whole model but a piece of it in the report? Thanks. Bookmark Like Share Sign in or register to reply. Notify Moderator 1 Reply Sort by Date ASC Date DESC Likes Sort by Date ASC Date DESC Likes Vladimir Bis on February 27, 2012 - 10:56 Hi Konstantin, try this code and change parameters in output.OutGraphicAbsolute method. var g_nLoc = Context.getSelectedLanguage(); var oModel = ArisData.getSelectedModels()[0]; var pict = oModel.Graphic(false, false, g_nLoc); var sPath = "C:\\Program Files\\ARIS71\\server\\templates\\scriptservice\\internal\\"; var bRet = pict.Save(sPath + oModel.Name(g_nLoc) + ".jpg"); if (bRet){ var output = Context.createOutputObject( Constants.OUTPDF, "report.pdf"); var imageData = Context.getFile(oModel.Name(g_nLoc) + ".jpg", Constants.LOCATION_INTERNAL) if (imageData.length > 0){ var image = Context.createPicture(imageData, Constants.IMAGE_FORMAT_JPG); output.OutGraphicAbsolute(image, -100, 0, 200, 100, false);// write scaled image (20cm x 10cm) to the output object output.WriteReport(); } } Like Sign in or register to reply. Notify Moderator
Vladimir Bis on February 27, 2012 - 10:56 Hi Konstantin, try this code and change parameters in output.OutGraphicAbsolute method. var g_nLoc = Context.getSelectedLanguage(); var oModel = ArisData.getSelectedModels()[0]; var pict = oModel.Graphic(false, false, g_nLoc); var sPath = "C:\\Program Files\\ARIS71\\server\\templates\\scriptservice\\internal\\"; var bRet = pict.Save(sPath + oModel.Name(g_nLoc) + ".jpg"); if (bRet){ var output = Context.createOutputObject( Constants.OUTPDF, "report.pdf"); var imageData = Context.getFile(oModel.Name(g_nLoc) + ".jpg", Constants.LOCATION_INTERNAL) if (imageData.length > 0){ var image = Context.createPicture(imageData, Constants.IMAGE_FORMAT_JPG); output.OutGraphicAbsolute(image, -100, 0, 200, 100, false);// write scaled image (20cm x 10cm) to the output object output.WriteReport(); } } Like Sign in or register to reply. Notify Moderator
Vladimir Bis on
Hi Konstantin,
try this code and change parameters in output.OutGraphicAbsolute method.
var g_nLoc = Context.getSelectedLanguage(); var oModel = ArisData.getSelectedModels()[0]; var pict = oModel.Graphic(false, false, g_nLoc); var sPath = "C:\\Program Files\\ARIS71\\server\\templates\\scriptservice\\internal\\"; var bRet = pict.Save(sPath + oModel.Name(g_nLoc) + ".jpg"); if (bRet){ var output = Context.createOutputObject( Constants.OUTPDF, "report.pdf"); var imageData = Context.getFile(oModel.Name(g_nLoc) + ".jpg", Constants.LOCATION_INTERNAL) if (imageData.length > 0){ var image = Context.createPicture(imageData, Constants.IMAGE_FORMAT_JPG); output.OutGraphicAbsolute(image, -100, 0, 200, 100, false);// write scaled image (20cm x 10cm) to the output object output.WriteReport(); } }