Hallo zusammen
Habe auch mal das Makro vom Jonas ausprobiert.
Geht soweit ganz gut aber wenn ein lehres Product dabei ist kommt Fehler.
Kann jemand mir helfen ( da ich von Programiersprache keine Ahnung habe) und das Makro so ändern dass es auch durchläuft wenn Lehre Produkte dabei sind.
Hier nochmal die Kopie
Language="VBSCRIPT"
Sub CATMain()
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim Document1, aktuPartDoc As Document
Set Document1 = CATIA.ActiveDocument
Dim PartSelektion As Selection
Set PartSelektion = Document1.Selection
PartSelektion.Search "CATProductSearch.Part,all"
Dim PartMenge, I As Integer
PartMenge = PartSelektion.Count
MsgBox(" PartMenge = " & PartMenge )
Dim aktuPart As Part
Dim DocDescription As String
Dim bodies1 As Bodies
Dim body1 As Body
For I =1 To PartMenge
Set aktuPart = PartSelektion.Item(I).value.ReferenceProduct.Parent.Part
DocDescription = aktuPart.Name
MsgBox("DocDescription = a" & DocDescription )
Set bodies1 = aktuPart.Bodies
Set body1 = aktuPart.MainBody 'Set body1 = bodies1.Item("Hauptkörper")
body1.name = DocDescription
Next
End Sub
Würde mich über eure Hilfe sehr freuen
------------------
Mit freundlichem Gruß
Andreas
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP