iLogic change Filename

iLogic change Filename

Anonymous
Not applicable
3,173 Views
5 Replies
Message 1 of 6

iLogic change Filename

Anonymous
Not applicable

Hi,

 

I am trying to make a rule in one assembly that changes the parameters of a part in it, like this:

 

Parameter("PERFIL UEEE.IPT", "d7")=COMPRIMENTO

 

 

But sometimes i have the necessity of changing the part filename and when i change it, the rule enters in error state because the filename changed, how can i make the rule "refresh" the part filename, PERFIL UEEE.IPT

0 Likes
3,174 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

You need to "stabalize" the name of the part

With the assembly open look for the part in the model tree. Rename the part in the model tree

 

Example rename "PERFIL UEEE" to "MY_PART"

Then use that in your rule 

 

Parameter("MY_PART.IPT", "d7")=COMPRIMENTO

Message 3 of 6

Anonymous
Not applicable

Right, that's usefull! 🙂 

 

But imagine that i can't "control" the Part name, is there a way that i can make a rule that goes read the current name of the Part end then use it?

0 Likes
Message 4 of 6

Anonymous
Not applicable
Let me try to explain another way.

When you rename the part in the model tree it retains that name even
when you do a replace or change ipart members.

So it remains constant the file name is irrelevant for the ilogic rule.

The rule uses the model tree name not the file name. So it will work
everytime regardless of which file name the part has.
0 Likes
Message 5 of 6

Anonymous
Not applicable

I understand that, i didn't explain entirely the case, so i have my original IAM and PART:

 

RFORÇO.IAM---> PERFIL UEE.IPT

 

Then I run this in a database program and it gives the IAM and PART new references to the files names, that are the same in the model tree name, for example:

 

1A300.IAM--->1A301.IPT

 

And, to my knowledge today, i can't change the names in the model tree,  so I was wondering if I can, with a rule, "read" the new names and use them to update the rules with the new names.

 

Was I clear? Hope so.

And thank you for the time spending with me.

 

0 Likes
Message 6 of 6

MechMachineMan
Advisor
Advisor

And I'm guessing the rules that reference the component/part names are in those parts?

 

Best solution I see is to write another iLogic that is run DURING THE RULE THAT CHANGES THE NAME that will go into the part's iLogic rule TEXT and replace String A with String B. String A being the old file name, and string B being the new file name.

 

Look into this thread for more info on iLogic Documentation.

 

https://forums.autodesk.com/t5/inventor-customization/ilogic-api-documentation/m-p/6785772/highlight...


--------------------------------------
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