iLogic rules not found on ipart

iLogic rules not found on ipart

rederle
Enthusiast Enthusiast
440 Views
6 Replies
Message 1 of 7

iLogic rules not found on ipart

rederle
Enthusiast
Enthusiast

Hi,

 

I wrote an iLogic rule (called Calcolo_Volume_dm3) to convert Volume from mm^2 to dm^3

 

(an custom iproperties called VOLUME_dm3 is writting)

 

Dim oValue As String = (Format(Round(iProperties.Volume / 1000000, 3), ".00"))
If oValue < 1 Then 
	iProperties.Value("Custom", "VOLUME_dm3") = "0" & oValue
Else
	iProperties.Value("Custom", "VOLUME_dm3") = oValue
End If

 

is't working well;

 

problem is just when I generate some ipart...if I open that one it gave me an error like:

 

"rules activates from ilogic events

RunRule: impossibile found a rule named "Calcolo_Volume_dm3" in that document"

 

I try to bypass that problem putting an external rule called "Calcolo_Volume_dm3" but it still not found

 

Have you some ideas to remove that error??

 

thanks

0 Likes
441 Views
6 Replies
Replies (6)
Message 2 of 7

WCrihfield
Mentor
Mentor

Is the rule (or the trigger to run the external rule) in the iPart 'factory' file (the 'master' iPart document, used to generate other 'slave' iParts), or is in in one or more of the 'slave' iPart documents?  There is a difference.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 7

WCrihfield
Mentor
Mentor

Also, when you are using the call "iProperties.Volume" in that rule, it will be attempting to retrieve that Volume from the 'active' document.  If the target iPart document isn't the 'active' document when that rule is ran, it won't work like you want either.  There are other ways to get the Volume of a model, that may be more stable, depending on your situation.  There is a specific iProperty called "Volume" in the "Design Tracking Properties" property set, you can access the long way (Document.PropertySets.PropertySet.Property.Value), and there are is the 'MassProperties' object, which has a 'Volume' property, which is normally found within the component definition of a model document.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 7

bradeneuropeArthur
Mentor
Mentor

ipart member have disabled commandtypes. I think therefore it will be no go to add ilogic code to the members!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 7

rederle
Enthusiast
Enthusiast

yes, it's in ipart facotory; I think is not possible to put a rule inside the ipart member...

 

I can share my file if you want to have a look

 

0 Likes
Message 6 of 7

bradeneuropeArthur
Mentor
Mentor

Think that is correct.

You cannot put code in an I part member!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 7

rederle
Enthusiast
Enthusiast

I think to found the issue;

 

problem is not inside iLogic rule but is on trigger; 

 

I think I have to set trigger rule not in "this document" but manage it with an external rule and put the external rule on all "parts / assembly"

 

additionally, ipart members already generate with ilogic rule set on "this document" must be delete and re-generate with the external rule set on parts/assembly

 

 

 

 

 

 

0 Likes