Analyze sketch

Analyze sketch

Anonymous
Not applicable
6,561 Views
2 Replies
Message 1 of 3

Analyze sketch

Anonymous
Not applicable

Hi All

 

Being all new and complete virgin-like, to ilogic, I would like to know wether it is possible to analyze a sketch (wenn it is being closed)?

 

What I want to analyze is:

 

Does the sketch contain a fully constrained closed loop?

Does this closed loop consist only of straight lines?

What is the total number of lines in the loop?

 

Next fase is:

Create an excel-sheet with the following information:

For each line in this closed loop i wish to add the length of the line, and the angle to the next line (consequently on the internal side of the loop, resulting in angles from 0 to 180 degrees)

 

Have any of you done something like this before?

 

Best Regards

 

Kristjan Geirsson

(ilogic virgin)

 

0 Likes
6,562 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

If you cannot find some functionality in the iLogic browser, then you can also use the Inventor API. If you need to use that the easiest is to try to write the code in VBA and then move it to iLogic.

 

This code iterates through all the sketches and then looks at their content - might be helpful as a starting point:

Dim doc As PartDocument
doc = ThisDoc.Document

Dim sk As PlanarSketch
For Each sk In doc.ComponentDefinition.Sketches
    Dim numNotLine As Integer
    numNotLine = sk.SketchEntities.Count - sk.SketchLines.Count

	MessageBox.Show( _
      "Sketch name = " + sk.Name + vbCrLf + _
      "Number of entities = " + Str(sk.SketchEntities.Count) + vbCrLf + _
      "Number of entities not a line = " + Str(numNotLine) + vbCrLf + _
      "ConstraintStatus = " + Str(sk.ConstraintStatus) + vbCrLf + _
      "kFullyConstrainedConstraintStatus = 51713", "Results")
Next

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks

Let me try this out and maybe go on from there!

 

BR Kristjan Geirsson

0 Likes