Thank you for code Mr. Harshal,
Do you have any suggestion to define a View from
3D option in VBA? Please see code and an icion in
attachment which I want to define
(View_from_3d.jpg). Thanks.
Sub CATMain()
Dim windows1 As Windows
Set windows1 = CATIA.Windows
Dim specsAndGeomWindow1 As SpecsAndGeomWindow
Set specsAndGeomWindow1 = windows1.Item("Part_name.CATPart")
specsAndGeomWindow1.Activate
Dim specsAndGeomWindow2 As SpecsAndGeomWindow
Set specsAndGeomWindow2 = windows1.Item("Drawing1")
specsAndGeomWindow2.Activate
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets
Dim oSheet As DrawingSheet
Set oSheet = drawingSheets1.ActiveSheet
specsAndGeomWindow1.Activate
Dim oIsoView As DrawingView
Set oIsoView = oSheet.Views.Add("View from 3D")
specsAndGeomWindow2.Activate
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Item("Part_name.CATPart")
Dim product1 As Product
Set product1 = partDocument1.GetItem("Part_name")
Dim oIsoViewGB As DrawingViewGenerativeBehavior
Set oIsoViewGB = oIsoView.GenerativeBehavior
oIsoViewGB.Document = product1
oIsoViewGB.DefineIsometricView 1#, 0#, 0#, 0#, 1#,
0# ' here I want to define a View from
3D option
oIsoView.X = 300
oIsoView.Y = 150
oIsoViewGB.Update
End Sub