Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
sam
Advocate
in reply to: JelteDeJong

Hi @JelteDeJong  again, 

 

As I explained earlier, I managed to create sketch by changing your recommended code as below but I can't add simple sketch entities on it. 

Public Sub AddSketch()

Dim testFace As String
testFace = "WebIntFace01"

Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument

Dim face As face
Set face = doc.AttributeManager.FindObjects(, , testFace)(1)

Dim sketch As PlanarSketch
Set sketch = doc.ComponentDefinition.Sketches.Add(face)

Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
   
Dim oCircle As SketchCircle
Set oCircle = oSketch1.SketchCircles.AddByCenterRadius(oTransGeom.CreatePoint2d(0, 0), 2)
    
End Sub

 

Error it gives is: Run-time error '424':

Object required. 

 

Any idea what am I doing wrong here. 

 

Best regards, 

Sam