cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

How to extract Dimension Texts from a CREO drawing using VB API?

HanSolo97
5-Regular Member

How to extract Dimension Texts from a CREO drawing using VB API?

Iam able to extract text from symbols and detail notes by getting a handle of notes/symbol using the following code,
modelitems =  detailItemOwner.ListDetailItems(EpfcDetailType.EpfcDETAIL_NOTE, 1)

Now i need to extract Dimension Texts from a drawing.
the modeItems that are returning from the above code does not contain dimension texts

Any idea on how to extract those informations?

 

HanSolo97_0-1606744153519.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
HanSolo97
5-Regular Member
(To:HanSolo97)

Found the solution myself
For anyone else having the same problem. here you go

 

For m = 0 To session.ListModels.Count - 1


model = session.ListModels.Item(m)
Dim ModType As Integer = model.Type

If model.Type = 1 Or model.Type = 0 Then

MIowner = CType(model, IpfcModelItemOwner)
MIs = MIowner.ListItems(EpfcModelItemType.EpfcITEM_DIMENSION)


For i = 0 To MIs.Count - 1


dimension = MIs.Item(i)
dimensions = dimension

shXL.Cells(J, 1) = dimensions.Symbol
shXL.Cells(J, 2) = dimensions.DimValue.ToString
shXL.Cells(J, 3) = model.FileName

Dim texts As Cstringseq = dimensions.Texts

For t = 0 To texts.Count - 1
str = str & texts.Item(t)
Next
shXL.Cells(J, 4) = str

J = J + 1

End Try

Next

End If
Next  

View solution in original post

1 REPLY 1
HanSolo97
5-Regular Member
(To:HanSolo97)

Found the solution myself
For anyone else having the same problem. here you go

 

For m = 0 To session.ListModels.Count - 1


model = session.ListModels.Item(m)
Dim ModType As Integer = model.Type

If model.Type = 1 Or model.Type = 0 Then

MIowner = CType(model, IpfcModelItemOwner)
MIs = MIowner.ListItems(EpfcModelItemType.EpfcITEM_DIMENSION)


For i = 0 To MIs.Count - 1


dimension = MIs.Item(i)
dimensions = dimension

shXL.Cells(J, 1) = dimensions.Symbol
shXL.Cells(J, 2) = dimensions.DimValue.ToString
shXL.Cells(J, 3) = model.FileName

Dim texts As Cstringseq = dimensions.Texts

For t = 0 To texts.Count - 1
str = str & texts.Item(t)
Next
shXL.Cells(J, 4) = str

J = J + 1

End Try

Next

End If
Next  
Top Tags