04-13-2020
06:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-13-2020
06:04 PM
@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