0

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):

AutoCAD Desktop

Forge Output:

Forge

Jeremy
  • 357
  • 1
  • 6
Alex R.
  • 1
  • 1
  • I recommend that you insert one more testing step so that we can isolate the issue. After testing it in full AutoCAD also test it in AcCoreconsole.exe on your local machine. This is closer to what's happening on Forge and will give us some clues as to what's going on. – Albert Szilvasy Mar 05 '20 at 17:56
  • Is your Activity only plotting? Or is it drawing anything? – Augusto Goncalves Mar 06 '20 at 16:52
  • @AlbertSzilvasy I have just tested with AcCoreConsole.exe and got the same output as from AutoCAD Desktop. No artifacts. Still seems to be a forge-only issue. – Alex R. Mar 07 '20 at 15:47
  • @AugustoGoncalves it is removing some layers, but it works fine on both AcCoreConsole and the desktop application. – Alex R. Mar 07 '20 at 15:48
  • @AlexR. we would need to reproduce the problem here, are you able to share the entire code (or DLL) and sample file? Feel free to use forge.help at autodesk.com email alias – Augusto Goncalves Mar 09 '20 at 21:37

0 Answers0