Hello AtomicNico,
Thank you for your rapid response.
I try to write something like this :
Imports ProductStructureTypeLib
Imports ElectricalTypeLib
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim CATIA As INFITF.Application
CATIA = GetObject(, "CATIA.Application")
If Err.Number = 0 Then
CATIA = CreateObject("CATIA.Application")
CATIA.Visible = True
End If
Dim Doc As ProductDocument
Doc = CATIA.ActiveDocument
Dim Prod As Product
Prod = Doc.Product
Dim path As String
path = Doc.Path
Datos = CATIA.FileSystem.CreateFile(path & "\" & CATIA.ActiveDocument.Name & ".xml", True)
ostream = Datos.OpenAsTextStream("ForAppending")
Try
Dim obj As ElectricalObject
Dim selection1 As Object
selection1 = Doc.Selection
selection1.Search("ElectricalObject")
For I = 1 To selection1.Count
obj = selection1.Item(I).Value
ostream.Write "Name" & selection1.Item(I).Name & ",Type" & selection1.Item(I).Type
Next
ostream.Write CATIA.ActiveDocument.Name & Chr(10)
ostream.Close()
Catch ex As Exception
TextBox1.Text = ex.ToString
End Try
End Sub
End Class
****
Any help please ?
Regards