70001071 GetModel2dProjection Method to create a more detailed output

Article 70001071
Type Wish
Product Engine
Version 7010
Date Added 4/28/2017 12:00:00 AM
Fixed 7.7011.0.5 (5/2/2017 12:00:00 AM)
Submitted by Mike Kruse

Summary

Is ti possible GetModel2dProjection Method to create a more detailed output?

Solution

A new property Model2dProjectionSize of document.GlobalRenderProperties was added in version 7011.0.5
Get/Set a static value that used to initialize rendering context size in pixels used by GetModel2dProjection.
Default value is 2048
Set a bigger value for more quality or smaller for less memory usage and more speed.


Example:

//Change the model view to front , create model projection entities and add them into a new layout

doc.CommandAction.View3D("VFRONT");
gPoint origin2 = doc.View2WorldMatrix.Transform(doc.ViewCenter);
doc.GlobalRenderProperties.Model2dProjectionSize = 8192;
linesegments segs = doc.GetModel2dProjection(origin2, doc.World2ViewMatrix.Zdir, 0.0);
vdLayout layout = doc.LayOuts.Add(doc.LayOuts.getUniqueTableName("section_2d_projection"));
layout.Entities.RemoveAll();
foreach (linesegment line in segs)
{
layout.Entities.AddItem(new vdLine(doc, line.StartPoint, line.EndPoint));
}
layout.ZoomExtents();

//Create the projection of the current view
           gPoint origin2 = doc.View2WorldMatrix.Transform(doc.ViewCenter);
           doc.GlobalRenderProperties.Model2dProjectionSize = 8192;
           double azim1=0;           double tilt1=0;           Vector vect=new Vector();           double twist1=0;
           doc.World2ViewMatrix.GetWorldToViewProperties(out vect, out azim1, out tilt1, out twist1);
           linesegments segs = doc.GetModel2dProjection(origin2, vect * -1.0, twist1);
           vdLayout layout = doc.LayOuts.Add(doc.LayOuts.getUniqueTableName("section_2d_projection"));
           layout.Entities.RemoveAll();
           foreach (linesegment line in segs)
           {
               layout.Entities.AddItem(new vdLine(doc, line.StartPoint, line.EndPoint));
           }
           layout.DisableShowPrinterPaper = true;
           layout.ZoomExtents();

Send comments on this topic.