Hej,
What is wrong with my code?
Respect
Santa
What is wrong with my code?
Code:
Sub CATMain()
Dim Component As Part
Dim MyDocument As Document
Set MyDocument = CATIA.Documents.Add("Part")
Set Component = MyDocument.Part
Dim part1 As CATBaseDispatch
Set part1 = MyDocument.GetItem("Part1")
part_name = InputBox("Part Name","")
part1.PartNumber = part_name
Dim MySketches As Sketches
Set MySketches = Component.MainBody.Sketches
'-------------------------------------------------------------
Dim HAxis, VAxis As Line2D
Set HAxis = Sketch.AbsoluteAxis.HorizontalReference
Set VAxis = Sketch.AbsoluteAxis.VerticalReference
'-------------------------------------------------------------
Dim OriginElement, MyPlane
Set OriginElement = Component.OriginElements
Set MyPlane = OriginElement.PlaneYZ
Dim Sketch As Sketch
Set Sketch = MySketches.Add (MyPlane)
'Dim Wzk As Factory2D
'Set Wzk = Sketch.OpenEdition
'Sketch.CloseEdition
Component.Update
End Sub
Respect
Santa