Grüss Dich,
mir ist es mit diesem Programm gelungen, ein Part in 3-D ins Drawing abzuleiten. Das Drawing ist bereits geöffnet und dann starte man das Macro.
Language="VBSCRIPT"
'Drawing aus Part erzeugen
'*******************************************************
Sub CATMain()
Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument
Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets
Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.Item("Sheet.1")
Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views
Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Add("AutomaticNaming")
Dim drawingViewGenerativeLinks1 As DrawingViewGenerativeLinks
Set drawingViewGenerativeLinks1 = drawingView1.GenerativeLinks
Dim drawingViewGenerativeBehavior1 As DrawingViewGenerativeBehavior
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As Document
Set partDocument1 = documents1.Item("PART6.CATPart")
Dim product1 As CATBaseDispatch
Set product1 = partDocument1.GetItem("PART6")
drawingViewGenerativeBehavior1.Document = product1
drawingViewGenerativeBehavior1.DefineFrontView 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
drawingView1.x = 594.500000
drawingView1.y = 420.500000
drawingView1.Scale = 1.000000
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior
drawingViewGenerativeBehavior1.Update
drawingView1.Activate
End Sub
'*************************************
Ich hoffe ich konnte Dir ein wenig weiterhelfen.
Ciao,
cChris
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP