IV10SP1: Possible to find small edges?

IV10SP1: Possible to find small edges?

Anonymous
Not applicable
306 Views
3 Replies
Message 1 of 4

IV10SP1: Possible to find small edges?

Anonymous
Not applicable
Dear all,

Not that up on the VB side of IV. Had a quick look through the programming help and couldn't figure out if this is viable:

Is it possible to highlight all edges on a part less than a (user) set length?

Would be useful for checking inadvertent break throughs of holes through surfaces, etc.

Kind regards,

Simon Heywood
Tronic Ltd UK
0 Likes
307 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Simon,

I've attached a macro that highlights all edges less than a user specified
length (specified in cms). It should work for all edge types (linear,
circular, etc.)

Sanjay-

Public Sub HighlightEdges()

Dim MinLength As Double
MinLength = InputBox("Enter minimum length in cm")

Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim odef As PartComponentDefinition
Set odef = oDoc.ComponentDefinition

Dim oHS As HighlightSet
Set oHS = oDoc.HighlightSets.Add

Call oHS.SetColor(255, 0, 0)

Dim oEdge As Edge

For Each oEdge In odef.SurfaceBodies(1).Edges

Dim MinParam As Double
Dim MaxParam As Double
Call oEdge.Evaluator.GetParamExtents(MinParam, MaxParam)

Dim EdgeLength As Double
Call oEdge.Evaluator.GetLengthAtParam(MinParam, MaxParam,
EdgeLength)

If EdgeLength < MinLength Then
oHS.AddItem oEdge
End If

Next

If oHS.Count > 0 Then
MsgBox "Edges less than " & MinLength & " cms in length highlighted
in red."
End If

oHS.Clear
End Sub

wrote in message news:4927005@discussion.autodesk.com...
Dear all,

Not that up on the VB side of IV. Had a quick look through the programming
help and couldn't figure out if this is viable:

Is it possible to highlight all edges on a part less than a (user) set
length?

Would be useful for checking inadvertent break throughs of holes through
surfaces, etc.

Kind regards,

Simon Heywood
Tronic Ltd UK
Message 3 of 4

Anonymous
Not applicable
Sanjay,

Thanks very much. I hadn't expected so much of an answer! I was only looking for whether it was possible or not, and then expected to spend a few weeks figuring it out. You've saved me a great deal of time.

I had to add in an "On Error Resume Next" before the For Loop though as I kept getting a "Run-time error '91': Object Variable or With block variable not set" on the line:

Call oEdge.Evaluator.GetParamExtents(MinParam, MaxParam)

I think this error is a bit miselading as the loop had obviously run a few times since edges were highlighted in the model.

Many thanks again.

Simon Heywood
Tronic UK Ltd
0 Likes
Message 4 of 4

Anonymous
Not applicable

I was looking for something like this, However I was wondering if you knew if there was a way to keep the edges highlighted after the textbox is closed, or some way to be able to do edits on the solid while the edges are highlighted?

 

 

0 Likes