set Sketch to reuse + VB.net or VBA

set Sketch to reuse + VB.net or VBA

Anonymous
Not applicable
414 Views
1 Reply
Message 1 of 2

set Sketch to reuse + VB.net or VBA

Anonymous
Not applicable

Hi,

 

How can i set the Sketch to reuse?

please VBA or VB

 

thx

 

0 Likes
Accepted solutions (1)
415 Views
1 Reply
Reply (1)
Message 2 of 2

xiaoyan.qi
Alumni
Alumni
Accepted solution

do you means you want to share a sketch?  the share sketch operation only works when the sketch is consumed by features.

Here is a simple VBA code

====================================

Sub makeSketchShared()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
   
    Dim oCompDef As PartComponentDefinition
    Set oCompDef = oDoc.ComponentDefinition
   
   
    Dim oSke As PlanarSketch

   ' "Sketch1" is the sketch name you want to reuse and consumed by features, change the name in your case
    Set oSke = oCompDef.Sketches.Item("Sketch1")
    oSke.Shared = True
End Sub

====================================

 

Let me know if it works

Thanks

Mick

0 Likes