Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Anyway for iLogic extents to ignore workplanes?

10 REPLIES 10
Reply
Message 1 of 11
kazsud
606 Views, 10 Replies

Anyway for iLogic extents to ignore workplanes?

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?

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
10 REPLIES 10
Message 2 of 11
jdkriek
in reply to: kazsud

Please post the rule (code).

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


Message 3 of 11
kazsud
in reply to: jdkriek

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

 

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
Message 4 of 11
jdkriek
in reply to: kazsud

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.


Message 5 of 11
kazsud
in reply to: jdkriek

Gettting this

 

 

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

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
Message 6 of 11
jdkriek
in reply to: kazsud

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.


Message 7 of 11
kazsud
in reply to: jdkriek

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

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
Message 8 of 11
jdkriek
in reply to: kazsud

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
kazsud
in reply to: jdkriek

Negative jd

 

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

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
Message 10 of 11
kazsud
in reply to: jdkriek

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

Thanks for clarifing that

Inventor 2017 SP1
Windows 10 Pro 64bit
Dell Precision T3600: Xeon E5-1607 0 @ 3.00GHz
Quadro 2000
16GB ram
Message 11 of 11
jdkriek
in reply to: kazsud

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.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report