Anyway for iLogic extents to ignore workplanes?

Anyway for iLogic extents to ignore workplanes?

Anonymous
Not applicable
896 Views
10 Replies
Message 1 of 11

Anyway for iLogic extents to ignore workplanes?

Anonymous
Not applicable

We have a iLogic Rule that measures extents (length, width + thickness) and for some reason it measures work planes instead of just the model. We have been resizing them until they are no longer sticking out but we don't always rememeber.

 

Any way to stop this from calculating?

0 Likes
897 Views
10 Replies
Replies (10)
Message 2 of 11

jdkriek
Advisor
Advisor

Please post the rule (code).

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 3 of 11

Anonymous
Not applicable
Imports System.Collections.Generic
  ' Make List(of T) type available

InventorVb.DocumentUpdate()

Dim sizes As New List(Of Double)

sizes.Add(Measure.ExtentsLength)
sizes.Add(Measure.ExtentsWidth)
sizes.Add(Measure.ExtentsHeight)

sizes.Sort()

Parameter("LENGTH") = sizes(2)
Parameter("WIDTH") = sizes(1)
Parameter("THICKNESS") = sizes(0)

iLogicVb.UpdateWhenDone = True

 

0 Likes
Message 4 of 11

jdkriek
Advisor
Advisor

Pretty simple 😉

 

Imports System.Collections.Generic

'Turn off work features so they dont calculate
ThisDoc.Document.ObjectVisibility.AllWorkFeatures = False

'Make List(of T) type available
InventorVb.DocumentUpdate()

Dim sizes As New List(Of Double)

sizes.Add(Measure.ExtentsLength)
sizes.Add(Measure.ExtentsWidth)
sizes.Add(Measure.ExtentsHeight)

sizes.Sort()

Parameter("LENGTH") = sizes(2)
Parameter("WIDTH") = sizes(1)
Parameter("THICKNESS") = sizes(0)

iLogicVb.UpdateWhenDone = True

'Turn back on work features - optional
ThisDoc.Document.ObjectVisibility.AllWorkFeatures = True
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 5 of 11

Anonymous
Not applicable

Gettting this

 

 

Public member 'ObjectVisibility' on type 'PartDocument' not found.

0 Likes
Message 6 of 11

jdkriek
Advisor
Advisor

Interesting, working fine in Inventor 2011-2013 - unfortunately I don't have 2010 to test with.

 

So for now just got to View > Object Visibility > Uncheck All Work Features

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 7 of 11

Anonymous
Not applicable

it's always done this weither they were on or off

0 Likes
Message 8 of 11

jdkriek
Advisor
Advisor

As soon as you turn off the workplane it doesn't calculate it, that's how extents works - it has to be enabled.

 

Here, try this workaround

 

Imports System.Collections.Generic
'Make List(of T) type available

Dim oApp As Application
oApp = ThisApplication
Dim oPart As PartDocument
oPart = oApp.ActiveDocument

'Turn off work features so they dont calculate
oPart.ObjectVisibility.AllWorkFeatures = False

InventorVb.DocumentUpdate()

Dim sizes As New List(Of Double)

sizes.Add(Measure.ExtentsLength)
sizes.Add(Measure.ExtentsWidth)
sizes.Add(Measure.ExtentsHeight)

sizes.Sort()

Parameter("LENGTH") = sizes(2)
Parameter("WIDTH") = sizes(1)
Parameter("THICKNESS") = sizes(0)

iLogicVb.UpdateWhenDone = True

'Turn back on work features - optional
oPart.ObjectVisibility.AllWorkFeatures = True
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 9 of 11

Anonymous
Not applicable

Negative jd

 

Still says Public member 'ObjectVisibility' on type 'PartDocument' not found.

0 Likes
Message 10 of 11

Anonymous
Not applicable

I tried my original rule and it did work when i manualy turned off all work features.

Thanks for clarifing that

0 Likes
Message 11 of 11

jdkriek
Advisor
Advisor

Ok, so it must be that 2010 doesnt support that through iLogic. I would find another method in VBA, because it's too easy for someone to turn it back on and mess up your extents. Whereas a script would always make sure it was turned off first before calculating. I'll keep looking for you.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes