I'm editing a script that shows diffs between 2 baselines and displays it in an HTML table. Some of the items that change are graphic figures. Is it possible to get these images out of DOORS so that I can display each baseline's version of the image, and if so, how do I do this?
Chris Christopher Cote - Mon Nov 07 13:53:58 EST 2016 |
Re: Retrieving an image (figure) with DXL You can export the image of OLE objects using the exportPicture perm. You can find examples on the forum and inside the DXL Reference Manual (OLE Information functions). Regards, Mathias |
Re: Retrieving an image (figure) with DXL Thank you Mathias. I'm looping through all objects in a particular baseline and comparing them with another baseline. If the objects are different, I am putting it into an HTML table for users to see the differences. I've been trying for a while now to figure out how to determine if an object is an image so I can use the correct markup to display the image. I have been looking at the Reference Manual and trying to match it up with what I'm doing, but I keep getting an error. This is the code I'm trying to use:
void writeNewObject(Stream out, Object o) {
EmbeddedOleObject ole
if (o."Object Heading" "" != "") {
out << "<h3>" " " o."Object Heading" "</h3><br />"
} else if (o.isOle) {
out << "<p>This object is a new image</p>"
string err = exportPicture(ole, "images/abc.png", formatPNG)
out << "<img src=\"images/abc.png\" width=\"200px\" />"
}
}
However, I am getting an error on the else if statement (o.isOle). The error I am getting is "incorrect arguments for (.)". Do I need to convert the object into RichText?
Chris |
Re: Retrieving an image (figure) with DXL chrscote - Wed Nov 16 09:23:26 EST 2016 Thank you Mathias. I'm looping through all objects in a particular baseline and comparing them with another baseline. If the objects are different, I am putting it into an HTML table for users to see the differences. I've been trying for a while now to figure out how to determine if an object is an image so I can use the correct markup to display the image. I have been looking at the Reference Manual and trying to match it up with what I'm doing, but I keep getting an error. This is the code I'm trying to use:
void writeNewObject(Stream out, Object o) {
EmbeddedOleObject ole
if (o."Object Heading" "" != "") {
out << "<h3>" " " o."Object Heading" "</h3><br />"
} else if (o.isOle) {
out << "<p>This object is a new image</p>"
string err = exportPicture(ole, "images/abc.png", formatPNG)
out << "<img src=\"images/abc.png\" width=\"200px\" />"
}
}
However, I am getting an error on the else if statement (o.isOle). The error I am getting is "incorrect arguments for (.)". Do I need to convert the object into RichText?
Chris you can either use
if(containsOle(o."Object Text")){
//something
}
to find out if the object text contains a ole or
RichText rtf;
string s = richTextWithOle(o."Object Text");
for rtf in s do{
if(rtf.isOle){
EmbeddedOleObject ole = rtf.getEmbeddedOle;
//something
}
}
to also get a handle to the ole. The 2nd option goes through each ole in the object text (in case you have more than one ole object per doors object) |