If Not lengthParam Is Nothing Then lengthParam.Value = 150.0 part.Update End If End Sub Sub SelectFace() Dim sel As Selection Set sel = CATIA.ActiveDocument.Selection sel.Clear ' Status returns "Normal" or "Cancel" Dim status As String status = sel.SelectElement("Face", "Select a face", False)
' Create sketch on XY plane Dim originElements As OriginElements Set originElements = part1.OriginElements Dim xyPlane As Reference Set xyPlane = originElements.PlaneXY dassault systemes vba 7.1
' In UserForm1 with TextBox1, CommandButton1 Private Sub CommandButton1_Click() GlobalHeight = CDbl(TextBox1.Text) Unload Me End Sub ' In main module Public GlobalHeight As Double If Not lengthParam Is Nothing Then lengthParam
| Element | Syntax Example | |--------|----------------| | Variable | Dim partDoc As Document | | Loop | For i = 1 To 10 ... Next i | | Condition | If Not partDoc Is Nothing Then ... | | Function | Function GetPartName() As String | | Error handling | On Error Resume Next / On Error GoTo ErrHandler | Start by recording simple macros, study the generated
Exit Sub ErrHandler: MsgBox "Error " & Err.Number & ": " & Err.Description End Sub This guide gives you a solid foundation for . Start by recording simple macros, study the generated code, then progressively build your own automation for part design, drawing generation, assembly constraints, or data extraction.
Dim shapeFactory As Factory2D Set shapeFactory = part1.ShapeFactory