SENL1362, thanks for trying it out. So in a fully completed API, the PlotterConfiguration class would have a media property/collection that one would be able to set directly. If I remember correctly, adding a custom size would require a PMP file linked to the PC3, which would need to be taken care of automatically as well. I also need to experiment more on how to best create a Media class, but I just haven't had time to test this in detail. However knowing that all of this wouldn't be complete up front I made sure to expose the all of the data via the node structure. That way one could still add in values to sub-nodes manually and have it function correctly. All this to say that I don't have a great sample to post yet dealing with media specifically. On the upside, the heavy lifting of reading/writing these files is done for the most part, so everything else should be fairly easy.
Ideally we'd have something that looks like this:
var filePath= @"C:\PlotTesting\Test.pc3"
var plotConfig = new PlotterConfiguration(filePath)
var newSize = new PC3Media
{
Name = ANSI B (17.00 x 11.00 Inches),
Bounds = new Bounds(17, 11),
PrintableBounds = new Bounds(16.54, 9.60),
Landscape = True
};
plotConfig.Media = newSize;
plotConfig.Write();
However since none of the media classes are implemented or supported yet it's going to be a lot uglier in the meantime. Here's what the inner data of a media node currently looks like:
selection_method=2
type="
dm_orientation=1
actual_printable_bounds_llx=5.7937498093 ( P,PL%T 8_0)
actual_printable_bounds_lly=17.793750763 ( 0#/+,4"%9@)
actual_printable_bounds_urx=273.60623169 ( (+,9<4"T7@)
actual_printable_bounds_ury=198.10624695 ( 8&;#:$ <30)
number_of_copies=1
size{
name="ANSI_A_(11.00_x_8.50_Inches)
group=0
landscape_mode=TRUE
longplot_reduction=1.0
media_description{
printable_bounds_llx=5.7937498093 ( P,PL%T 8_0)
printable_bounds_lly=17.793750763 ( 0#/+,4"%9@)
printable_bounds_urx=273.60623169 ( (+,9<4"T7@)
printable_bounds_ury=198.10624695 ( 8&;#:$ <30)
printable_area=48289.937117 ("J#
dimensional=TRUE
media_bounds{
urx=279.39999390 ( 8&9V<4!J5P)
ury=215.89999390 ( P,S\:D"QW0)
}
}
}
A lot of that is straighforward, however I haven't figured out those encrypted looking sections trailing the bounds and area. I'll look into adding the functionality this week and updating the Git project.