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


@JelteDeJong wrote:

named faces are attributes under the hood. try this vba code.  just change the namedFace vaiable to what ever you named the face.

 

Dim namedFace As String
namedFace = "testFace"

Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument

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

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

 

 


Hi, 

thanks for the reply. 

I tried this and got the following error. 

 

 

Public Sub AddSketch()

Dim WebIntFace01 As String
WebIntFace01 = "testFace"

Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument

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

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

End Sub

 

 

Error: Run-time error '5':

Invalid Procedure call or argument. 

 

Also before testing I knew something was unusual about the code. What purpose we are achieving in second line by declaring WebIntFace01 = "testFace". 

Did I do something wrong here?

 

Best regards, 

Sam