Specifies whether or not edge and hatch style use model colors
Visual Basic |
---|
Public Property EdgesUseModelColor As Boolean |
Imports System.IO Imports System.Runtime.InteropServices Module Example <STAThread()> _ Sub Main() Dim objApplication As SolidEdgeFramework.Application = Nothing Dim objDocuments As SolidEdgeFramework.Documents = Nothing Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing Dim objSections As SolidEdgeDraft.Sections = Nothing Dim objSection As SolidEdgeDraft.Section = Nothing Dim objSheet As SolidEdgeDraft.Sheet = Nothing Dim objDrawingViews As SolidEdgeDraft.DrawingViews = Nothing Dim objDrawingView As SolidEdgeDraft.DrawingView = Nothing Try OleMessageFilter.Register() ' Start Solid Edge objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application")) objApplication.Visible = True objDocuments = objApplication.Documents objDraftDocument = objDocuments.Open("anyfilename.dft") objSections = objDraftDocument.Sections objSection = objSections.WorkingSection ' Update all drawing views in all working sections. For Each objSheet In objSection.Sheets objDrawingViews = objSheet.DrawingViews For Each objDrawingView In objDrawingViews objDrawingView.EdgesUseModelColor = True objDrawingView.EdgesUsePartBaseColor = True objDrawingView.EdgesUseAssemblyOverrideColor = False objDrawingView.SectionHatchUseModelColor = True objDrawingView.Update() Next Next Catch ex As Exception Console.WriteLine(ex.Message) Finally OleMessageFilter.Revoke() End Try End Sub End Module
using System.IO; using System.Runtime.InteropServices; internal static class Example { [STAThread()] public static void Main() { SolidEdgeFramework.Application objApplication = null; SolidEdgeFramework.Documents objDocuments = null; SolidEdgeDraft.DraftDocument objDraftDocument = null; SolidEdgeDraft.Sections objSections = null; SolidEdgeDraft.Section objSection = null; // SolidEdgeDraft.Sheet objSheet = null; SolidEdgeDraft.DrawingViews objDrawingViews = null; // SolidEdgeDraft.DrawingView objDrawingView = null; try { OleMessageFilter.Register(); // Start Solid Edge objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application")); objApplication.Visible = true; objDocuments = objApplication.Documents; objDraftDocument = objDocuments.Open("anyfilename.dft"); objSections = objDraftDocument.Sections; objSection = objSections.WorkingSection; // Update all drawing views in all working sections. foreach (SolidEdgeDraft.Sheet objSheet in objSection.Sheets) { objDrawingViews = objSheet.DrawingViews; foreach (SolidEdgeDraft.DrawingView objDrawingView in objDrawingViews) { objDrawingView.EdgesUseModelColor = true; objDrawingView.EdgesUsePartBaseColor = true; objDrawingView.EdgesUseAssemblyOverrideColor = false; objDrawingView.SectionHatchUseModelColor = true; objDrawingView.Update(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { OleMessageFilter.Revoke(); } } }