API code to get kFactor not correct?

API code to get kFactor not correct?

dominiek_vanwest
Advocate Advocate
563 Views
2 Replies
Message 1 of 3

API code to get kFactor not correct?

dominiek_vanwest
Advocate
Advocate

Hi,

 

I think the code to get the actual kFactor is not correct (and I don't mean my code is not correct but the API from Autodesk itself!).

I made a screencast to make it easier to explain.

- I have a part with a certain Sheet Metal Rule (3mm in my example).

- This Sheet Metal Rule uses the Unfold Rule (3mm_KFactor).

- The kFactor for this Unfold Rule is 0,1 ul.

- But in the Sheet Metal Defaults I say I want to use another Unfold Rule: Default_KFactor.

- The kFactor for this Unfold Rule is 0,5.

- If I use the vb code to get the kFactor I don't get the kFactor from the Unfold Rule I selected, but I get the kFactor form the Sheet Metal Rule I selected.

 

Is this a bug? Or did I do something wrong? Or is there another code to get the actual kFactor?

 

Regards,

Dominiek

0 Likes
Accepted solutions (2)
564 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor
Accepted solution

Nope.

 

What your code queries is the kFactor for the SheetMetalStyle.

 

As it happens, the style is overridden by the value in the component definition.

 

The proper code looks something like:

 

SheetMetalComponentDefinitionObject.UnfoldMethod.kFactor

(or something that does not reference the style first)

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-84F46E82-CB22-4BE6-9262-03D6DFAE79D6


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

dominiek_vanwest
Advocate
Advocate
Accepted solution

Thank you for the reply!

 

I found the solution:

Instead of

oSheetMetalDef.ActiveSheetMetalStyle.UnfoldMethod.kFactor

It's

 

oSheetMetalDef.UnfoldMethod.kFactor

(so basically remove the ActiveSheetMetalStyle)

 

 

Regards,

Dominiek

0 Likes