Autodesk Inventor Customization
- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I want to simply set a custom iproperty as the Description in each part file within my assembly. I can do this easily at part level with ilogic but I want to be able to run the rule from the assembly level and all the parts run the rule. I am struggling to find a way to do this.
I think this may be the best method I have found but I think it must be far easier?
http://inventortrenches.blogspot.com/search/label/
Thanks,
Guy
XP 32-Bit SP3
Solved! Go to Solution.
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Will the description be something that is derived from a parameter within each part, a manual entry, or perhaps a parameter in the assembly, OR something just hardcoded?
If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.
Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
We have a PLM system which populates a custom iproperty with the description entered in the PLM. We also have some old parts which have the description in the Description field but not the custom iproperty. I want to write a rule which will ensure I can call the Description field in a parts list. If I do this currently some descriptions are blank.
Can you help?
Thanks,
Guy
XP 32-Bit SP3
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
So your PLM system does a lot of the grunt work of populating the custom iprop. You just want to make sure that the custom iprop exists, correct?
If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.
Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I want to make sure that if the custom iprop exists it is copied to the Description field under the project tab. I think it's dangerous to copy the other way as this is data placed in the part from the PLM system. That way I can run the rule in the assembly and ensure I have the description for each part in my Parts List. Some of the legacy parts in the PLM had the description stored in the Description field.
I do not know why it was changed......
cheers,
Guy
XP 32-Bit SP3
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Alright. I made this during lunch just now, and have not tested it, but you should be able to throw this into a rule in the main assembly file and let it do its thing.
Basically it just goes through all of the parts in the assembly, and will set the Project's - Description iproperty, to match a custom iproperty of your desire. Just be sure to replace the custom iproperty name in the code with the one you'll be using.
Dim openDoc As Document openDoc = ThisDoc.Document Dim docFile As Document If openDoc.DocumentType = 12291 Then For Each docFile In openDoc.AllReferencedDocuments If docFile.DocumentType = 12290 Then iProperties.Value(docFile.DisplayName, "Project", "Description") = iProperties.Value(docFile.DisplayName, "Custom", "YOURiPropNAMEHERE") End If Next End If
If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.
Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Sorry for the delay replying. Start of the day in the UK now.
Thanks a lot for the help and the rule. I tried it and receive an error when it's run.
I've used a test assembly. Here is the detail of the message
Cheers,
Guy
XP 32-Bit SP3
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I just tested this. It should work, but it assumes that you have your occurrence names set to the filename, and that there is always one of them named with the suffix of “:1” (So if you have a filename called FrankyLovesCake.ipt it assumes the Occurrence name is FrankyLovesCake:1).
Later on, I’ll try to make this more solid and less awful.
New Code :
Dim openDoc As Document
openDoc = ThisDoc.Document
Dim docFile As Document
If openDoc.DocumentType = 12291 Then
For Each docFile In openDoc.AllReferencedDocuments
If docFile.DocumentType = 12290 Then
Dim OccName As String
OccName = Left(docFile.DisplayName, Len(docFile.DisplayName) - 4) & ":1"
iProperties.Value(OccName, "Project", "Description") = iProperties.Value(OccName, "Custom", "CUSTOM_NAME_HERE")
End If
Next
End If
If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.
Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Thanks I really appreciate the help. The file name and occurrence names differ unfortunately. As an example. The file name = doc-0000837756_0.ipt yet the occurrence name = DOC-0000837756-PART_GLFT_0003-PART-ID-2301831:1
This is generated by the software we have which links to the PLM.
Cheers,
Guy
XP 32-Bit SP3
Re: Run ilogic rule in each part from the assembly via external rule?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Yeah. I figured that might be the case. Once I get some time, I'll change how it goes about messing with things, and maybe all will be well in the end!.
If my solution seems to remedy your problem, please press the Accept Solution button, -
as it increases my power levels and will eventually help to elevate me towards outer space.
Check out my iLogic injection tool here : http://goo.gl/ce1Qg
--------------------------------------------------------------------------------------



