Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic material change failure

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mrattray
990 Views, 2 Replies

iLogic material change failure

The attached part has some bad work features on it, but I don't care about that (easy fix). It also contains a rule that simply changes the material from "P AND O" (pickles & oiled) to "201 S/S", for some reason the faulty work geometery causes this rule to throw an "unspecified error". If you delete the bad work geometry the rule runs fine.

This is easy enough for me to fix, I'll just repair the work features, but I thought AutoDesk or anyone else having a similar problem would like to see it.

Mike (not Matt) Rattray

2 REPLIES 2
Message 2 of 3
bobvdd
in reply to: mrattray

Thanks for reporting this Michael.

 

I think what And I are looking at here is not an iLogic defect but more an API defect.

 

Once a part cannot be rebuild succesfully and shows sick features, you cannot change its material via the API.

Here is a short macro that demonstrates my thesis.

 

Sub test()
Dim odoc As PartDocument
Set odoc = ThisApplication.ActiveDocument
odoc.ComponentDefinition.Material = ThisApplication.StylesManager.Materials.Item(1)
End Sub

 

This macro will trigger a run-time error. Like you said once you fix the sick features, teh macro and your iLogic rule runs succesfully.

 

I have logged it as defect 1462734 Cannot change material via API on a sick part

 

Thanks

Bob




Bob Van der Donck


Principal UX designer DMG group
Message 3 of 3
bobvdd
in reply to: bobvdd

Michael,

 

I checked with our developers and this problem has been fixed in the next release of Inventor.

Because Materials are no longer in the Style editor since 2013, we are working on replacing the API call

 

      ThisApplication.StylesManager.Materials 

 

to

 

      ThisApplication.AssetLibraries(3).MaterialAssets(10).

 

And this new call no longer has the problem with sick parts.

In the meantime try to avoid working with sick parts when you attempt material changes in your VBA or iLogic code.

 

Thanks

Bob




Bob Van der Donck


Principal UX designer DMG group

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

Post to forums  

Autodesk Design & Make Report