//-------------------------------------------------------------------------------------------------- public bool Export(string fileName, IVectorExporter exporter, IEnumerable <TopoDS_Shape> breps) { VectorExportLayer[] layers = PrepareExportLayers(breps); if (layers == null || layers.Length == 0) { Messages.Error("No lines left to export after HLR processing."); return(false); } return(exporter.DoExport(fileName, VectorExportTemplate.Drawing, layers)); }
//-------------------------------------------------------------------------------------------------- bool DoExport(string filename, IVectorExporter exporter) { try { var projection = new Ax3(_Viewport.EyePoint, _Viewport.GetViewDirection().Reversed(), _Viewport.GetRightDirection()); var exportHelper = new DrawingExportHelper(Settings.UseTriangulation, projection); if (Settings.VisibleOutline) { exportHelper.IncludeEdgeType(HlrEdgeType.VisibleSharp); exportHelper.IncludeEdgeType(HlrEdgeType.VisibleOutline); } if (Settings.VisibleSmooth) { exportHelper.IncludeEdgeType(HlrEdgeType.VisibleSmooth); } if (Settings.VisibleSewn) { exportHelper.IncludeEdgeType(HlrEdgeType.VisibleSewn); } if (Settings.HiddenOutline) { exportHelper.IncludeEdgeType(HlrEdgeType.HiddenSharp); exportHelper.IncludeEdgeType(HlrEdgeType.HiddenOutline); } if (Settings.HiddenSmooth) { exportHelper.IncludeEdgeType(HlrEdgeType.HiddenSmooth); } if (Settings.HiddenSewn) { exportHelper.IncludeEdgeType(HlrEdgeType.HiddenSewn); } return(exportHelper.Export(filename, exporter, InteractiveContext.Current.WorkspaceController.VisualShapes.GetVisibleBReps())); } catch (Exception e) { Messages.Exception("Exception while exporting line drawing from viewport.", e); return(false); } }