Check Sketch with Feature

Check Sketch with Feature

Anonymous
Not applicable
335 Views
2 Replies
Message 1 of 3

Check Sketch with Feature

Anonymous
Not applicable

The following problem occurs in my automation process.

In my case some of the sketch closed entities are not converted as solid while using extrude feature.

So some cuts are missing.

I need to confirm whether all the closed entities are converted as solid. Otherwise i need to show user about the extrude feature conversion error.

Guide me how to identify whether all the closed profiles are converted as Solid?

0 Likes
336 Views
2 Replies
Replies (2)
Message 2 of 3

dutt.thakar
Collaborator
Collaborator

Hello @Anonymous ,

 

If you just want to check whether your sketch is owned by feature or not below code will work, if you have open profile sketch and still it is consumed by extrude surface, it will not be shown using below code. it will only show the sketches that are orphan (i.e. not used in any feature).

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition 
Dim oSketch As PlanarSketch

For Each oSketch In oDef.Sketches
	If oSketch.IsOwnedByFeature= True   ' You can use oSketch.Consumed = False as well to check here.
		MessageBox.Show(oSketch.Name")
	End If
Next

 

If this has answered your question, please accept this as solution.

 

Regards,

Dutt Thakar

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor

You should study the contents of this link.  It describes the Function "AddForSolid()" used to prepare a sketche's profiles for an extrusion feature.

Profiles.AddForSolid Method 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes