I have been looking for an answer to this question for 5 days now, The question is: If I have many bodies with the same name and one of them is released as a publication. Now, how can I know which body is released as a publication. Is there a way to compare a publication with each body (please remember that the names of bodies are the same). And can I access the body with the publication object? please respond if you have any idea about it. Thanks
Asked
Active
Viewed 290 times
1 Answers
1
Therefor you can use the selection as a workaround: Get the reference of the publication and select this reference
Sub CATMain()
Set oPartDocument = Catia.ActiveDocument
Set oPublication = oPartDocument.Product.Publications.Item(1)
Set oSel = oPartDocument.Selection
Set oReference = oPublication.Valuation
oSel.Clear
oSel.Add oReference
Set oSelObject = oSel.Item2(1).Value
MsgBox oSelObject.Name
End Sub

Shrotter
- 350
- 3
- 9
-
Hi Shrotter, i tried as you said but the selection object (oSel) is not adding the reference object as shown in above code – Naveen Prajapati May 02 '22 at 16:31
-
1Hi, so are oPublication and oSel assigned (_Set_)? On my test this code works. – Shrotter May 02 '22 at 16:35
-
Thank you Shrotter for the help, the workaround works. There was a little mistake in my code. – Naveen Prajapati May 02 '22 at 17:07