Details
How to get horizontal and vertical alignment of existing text?
Solution
Imports System.IO
Imports System.Runtime.InteropServices
Imports SolidEdgeAssembly
Imports SolidEdgeFramework
Imports SolidEdgeConstants
Module Module1
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheet As SolidEdgeDraft.Sheet = Nothing
Dim objTextBoxs As SolidEdgeFrameworkSupport.TextBoxes = Nothing
Dim objTextBox As SolidEdgeFrameworkSupport.TextBox = Nothing
Dim objTextEdit As SolidEdgeFrameworkSupport.TextEdit = Nothing
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objDraftDocument = objApplication.ActiveDocument
objSheet = objDraftDocument.ActiveSheet
objTextBoxs = objSheet.TextBoxes
objTextBox = objTextBoxs.Item(1)
Dim horizontalAlignment As SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants = objTextBox.Edit.HorizontalAlignment
Dim verticalAlignment As SolidEdgeFrameworkSupport.TextJustificationConstants = objTextBox.VerticalAlignment
MsgBox("The current applied Horizontal alignment is = " + horizontalAlignment.ToString() + " and vertical alignemnt is = " + verticalAlignment.ToString())
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
Console.WriteLine("GTAC")
End Try
End Sub
End Module
Hardware/Software Configuration
Platform: AMD64
OS: window
OS Version: 764
Product: SOLID_EDGE
Application: AUTOMATION
Version: V110.0
Function: API_DOCUMENT
Ref: 002-8014220