CATIA VB : Get document path from product
CATIA VB : Get document path from product
(OP)
Hi there,
I do have difficulties to find out something :
I have a product, containing subproducts and parts.
I want to display the file name of each parts/products.
I can do it by using the document structure :
MsgBox CATIA.Documents.item(i).FullName
The thing is, the Document structure will skip missing files (references not foud) and I want to display the file name of missing files as well, so i'd like to use the Product structure, but product structure does'nt have a .FullName property.
To sum up :
I have a tree like this :

I want to get & display the "[Part1.CATPart]"
(and not just the product.name "Part1.1")
Thanks if someone here can help me.
I do have difficulties to find out something :
I have a product, containing subproducts and parts.
I want to display the file name of each parts/products.
I can do it by using the document structure :
MsgBox CATIA.Documents.item(i).FullName
The thing is, the Document structure will skip missing files (references not foud) and I want to display the file name of missing files as well, so i'd like to use the Product structure, but product structure does'nt have a .FullName property.
To sum up :
I have a tree like this :

I want to get & display the "[Part1.CATPart]"
(and not just the product.name "Part1.1")
Thanks if someone here can help me.





RE: CATIA VB : Get document path from product
CODE -->
Sub Get_Name() Dim objProduct As Product Set objProduct = CATIA.ActiveDocument.Product Dim ProdDoc As ProductDocument Set ProdDoc = objProduct.ReferenceProduct.Parent Dim objStiEngine As StiEngine Set objStiEngine = CATIA.GetItem("CAIEngine") Dim ProdStiItem As StiDBItem Set ProdStiItem = objStiEngine.GetStiDBItemFromAnyObject(ProdDoc) Dim strProdDocName As String strProdDocName = ProdStiItem.GetDocumentFullPath() Dim curStiItem As StiDBItem Dim strStiDocName As String Dim StiChildrenList As StiDBChildren Set StiChildrenList = ProdStiItem.GetChildren() Dim i As Integer For i = 1 To StiChildrenList.Count Set curStiItem = StiChildrenList.Item(i) strStiDocName = curStiItem.GetDocumentFullPath x = Len(strStiDocName) y = InStrRev(strStiDocName, "\") z = x - y MsgBox Right(strStiDocName, z) Next i End SubRE: CATIA VB : Get document path from product
That is exactly what I was looking for :)