Solid Edge Please tell me how to use Text-Justification of text toolbar in Solid Edge code

2021-10-06T23:55:38Z
PART/SHEETMETAL

Summary


Details

Please tell me how to use Text-Justification of text toolbar in Solid Edge code




Solution

User can run below code to use Text-Justification of text toolbar in Solid Edge code,

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.Add(x1:=0.3, y1:=0.4, z1:=0)
            objTextBox = objTextBoxs.AddByTwoPoints(x1:=0.3, y1:=0.4, z1:=0.0, x2:=0.1, y2:=0.3, z2:=0)
            objTextBox.Edit.HorizontalAlignment = SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants.igTextHzAlignRight
            objTextBox.Text = "Some text"
            objTextBox.VerticalAlignment = SolidEdgeFrameworkSupport.TextJustificationConstants.igTextJustifyCenter


        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: V109MP7
Function: API_DOCUMENT

Ref: 002-8013898

KB Article ID# PL8013898

Contents

SummaryDetails

Associated Components

PART/SHEETMETAL: FEATURES