Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic change Filename

5 REPLIES 5
Reply
Message 1 of 6
AMCardoso
2341 Views, 5 Replies

iLogic change Filename

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

Tags (2)
5 REPLIES 5
Message 2 of 6
swordmaster
in reply to: AMCardoso

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

Inventor 2010 Certified Professional
Message 3 of 6
AMCardoso
in reply to: swordmaster

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?

Message 4 of 6
swordmaster
in reply to: AMCardoso

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.
Inventor 2010 Certified Professional
Message 5 of 6
AMCardoso
in reply to: swordmaster

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.

 

Message 6 of 6
MechMachineMan
in reply to: AMCardoso

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

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

Post to forums  

Autodesk Design & Make Report