How can I break link reference component of sketch

How can I break link reference component of sketch

tim11_manhhieu
Advocate Advocate
178 Views
2 Replies
Message 1 of 3

How can I break link reference component of sketch

tim11_manhhieu
Advocate
Advocate

I am trying to break link reference component of sketch show as image.

Did i do something wrong?

 

tim11_manhhieu_0-1748312590946.png

 

tim11_manhhieu_4-1748312886072.png

 

tim11_manhhieu_5-1748312907984.png

 

Option Explicit

Sub zzzzzzzzzzz()

Dim oPart As PartDocument
Set oPart = ThisApplication.ActiveDocument

Dim oPartDef As ComponentDefinition
Set oPartDef = oPart.ComponentDefinition

Dim oSketch As PlanarSketch
Set oSketch = oPart.ComponentDefinition.Sketches.item("Sketch29")

oSketch.ReferenceComponent.BreakLinkToFile

End Sub

 

 

 

0 Likes
Accepted solutions (1)
179 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Have you tried PlanarSketch.BreakLink method?

Another alternative may be to iterate through every SketchEntity in the sketch, and set the SketchEntity.Reference property's value to False, since that is a ReadWrite property.  It says the only valid value we can set is False, since just specifying True does not specify what the entity would be getting referenced to, and can not reestablish any association.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

tim11_manhhieu
Advocate
Advocate

It's still error.


tim11_manhhieu_1-1748390667657.png

 

-----------------------------------------------------------

 

I tried method oSketchEntity.Reference = False and it worked.

The purpose of my breaking link is to remove the projected entity.

Although reference21 is still left, the above method is still OK.

 

tim11_manhhieu_2-1748391138353.png

 

tim11_manhhieu_3-1748391169139.png

 

 

 

 

0 Likes