I am currently trying to standardize some cleaning and plot functions on Autodesk Forge. My development process is to write my Design Automation plugins in Visual Studio, test in Autocad Desktop (Windows) via the NETLOAD command, and then push to forge.
However, I am noticing huge differences between the output in Forge and the Output in AutoCAD.
First, in forge my plot gets created with black rectangle borders for some reason. The centering is also very different in Forge even though I am taking steps in my script to set it.
Here is the printing part of my script:
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(
db.CurrentSpaceId,
OpenMode.ForRead, false, true
);
Layout lo = (Layout)tr.GetObject(
btr.LayoutId,
OpenMode.ForRead, false, true
);
PlotInfo pi = new PlotInfo();
pi.Layout = btr.LayoutId;
PlotSettings ps = new PlotSettings(lo.ModelType);
ps.CopyFrom(lo);
PlotSettingsValidator psv = PlotSettingsValidator.Current;
psv.SetPlotType(
ps,
Autodesk.AutoCAD.DatabaseServices.PlotType.Extents
);
psv.SetUseStandardScale(ps, true);
psv.SetStdScaleType(ps, StdScaleType.ScaleToFit);
psv.SetPlotCentered(ps, true);
psv.SetPlotConfigurationName(
ps,
"DWG To PDF.pc3",
"ANSI_A_(8.50_x_11.00_Inches)"
);
pi.OverrideSettings = ps;
PlotInfoValidator piv = new PlotInfoValidator();
piv.MediaMatchingPolicy =
MatchingPolicy.MatchEnabled;
piv.Validate(pi);
}
Here's an example difference between Forge and AutoCAD Desktop with the exact same script:
AutoCAD Desktop (this is what its intended to look like):
Forge Output: