Change Dimensions delimiter coma "," with Period "." in Draft

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Dear all,

 

I want to change all Dimensions delimiter coma ","  with Dot or Period "." in Draft with VB.NET. But can't do it.

 

I have use following but it is give message of "mismatch".

Dim dimensions As SolidEdgeFrameworkSupport.Dimensions = Nothing

dimensions.Style.Delimiter = SolidEdgeFrameworkSupport.DimDelimiterTypeConstants.igDimStyleDelimiterDot

 

 

How to use following:

Public Const igDimStyleDelimiterDot As SolidEdgeFrameworkSupport.DimDelimiterTypeConstants = 1
Public Const igDimStyleDelimiterDot As SolidEdgeConstants.DimDelimiterTypeConstants = 1

Public Property Delimiter As DimDelimiterTypeConstants

 

Thanks,

Irfan Pathan

 

 

4 REPLIES

Re: Change Dimensions delimiter coma "," with Period "." in Draft

Phenom
Phenom

Dear Irfan:

 

Post programming related questions to the Developer Forum.

 

You can change the delimiter for all dimensions as below:

 

Dim seApp As SolidEdgeFramework.Application = Marshal.GetActiveObject("SolidEdge.Application")
        
Dim seDoc As SolidEdgeDraft.DraftDocument = seApp.ActiveDocument
Dim seDimensions As SolidEdgeFrameworkSupport.Dimensions = seDoc.ActiveSheet.Dimensions

For Each seDimension As Dimension In seDimensions
  seDimension.Style.Delimiter = SolidEdgeFrameworkSupport.DimDelimiterTypeConstants.igDimStyleDelimiterDot
 Next

In your code, you have assigned dimensions to nothing.

Even if you assign it to existing dimensions, the Style property was found to be Nothing

Hence, changing the delimiter would always fail.

You can report this to GTAC via your company.

  

Regards,

~Tushar Suradkar

fb.pngSolid Edge Users Facebook Group

[ Everything under the Sun about - Solid Edge ]

Re: Change Dimensions delimiter coma "," with Period "." in Draft

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Thanks Tushar.

 

I have one change only.

 

For Each seDimension As Dimension In seDimensions  ===> 

For Each seDimension As  SolidEdgeFrameworkSupport.Dimension In seDimensions

 

Is It Possible to change all dimension delimiter with one line code?

 

With  unit's delimiter of "Dimensions Properties" (Kindly refer attached Image).

 

Thanks again.

Irfan Pathan

 

 

Re: Change Dimensions delimiter coma "," with Period "." in Draft

Phenom
Phenom

Hi Irfan:

 

When reading your question first time I had written code for changing the delimiter in the dimension style itself but the problem would be only dimensions using a particular DimStyle will be affected. How are you going to ensure this ? 

One way as shown in my code is to have one dimension selected (for demo purpose only.)

You can alternatively pick the Item(1) of the dimensions collection to extract the DimStyle to modify.

 

Here's the code:

        Dim seApp As Application = Marshal.GetActiveObject("SolidEdge.Application")
        Dim seDoc As DraftDocument = seApp.ActiveDocument

        Dim seSelSet As SelectSet = seDoc.SelectSet
        Dim seDim As Dimension = seSelSet.Item(1)

        Dim seDimStyles As DimensionStyles = seDoc.DimensionStyles
        Dim sDimStyleName As String = seDim.Style.Name
        Dim seDimStyle As DimensionStyle = Nothing

        For Each o As DimensionStyle In seDimStyles
            If o.Name = sDimStyleName Then
                seDimStyle = o
            End If
        Next

        seDimStyle.Delimiter = SolidEdgeFrameworkSupport.DimDelimiterTypeConstants.igDimStyleDelimiterDot

Regards,

~Tushar Suradkar

fb.pngSolid Edge Users Facebook Group

[ Everything under the Sun about - Solid Edge ]

Re: Change Dimensions delimiter coma "," with Period "." in Draft

Phenom
Phenom

Isn't changing this in windows enough?

NYE2y86

...........................................................................................................
Solid Edge ST10 & AutoCAD 2018.1 user