Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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 reference issues with using an assembly as a template for other projects

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
mBASOM
921 Views, 9 Replies

iLogic reference issues with using an assembly as a template for other projects

Background:

I'm trying to create a standard template for our assemblies so that you just have to change the size of the parts using an iLogic form. I also have it linked to an .idw so that we don't have to go in and detail each new assembly. The assembly code makes reference to the specific files/parameters that the parts are in/have.

 

The issue:

So, when I do a save as/copy the files over to make a new assembly, the code doesn't change with the new file names and therefore my code doesn't work correctly. Is there a way to code it to where it pulls the new file names from the parts,  or in general a better way to use this file as a template?

 

Autodesk Inventor Professional 2018

9 REPLIES 9
Message 2 of 10
johnsonshiue
in reply to: mBASOM

Hi! Without seeing an example, I can only speculate. I suspect you may have a static file name in your rule which is different than the file you create from the template.

Please share the files and the rule here so forum experts can take a look.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 10
mBASOM
in reply to: johnsonshiue

I've included all of the files but the main issue is in the assembly itself in the rules for the "Column Cutout" and "Sum of Weights" I call those parameters out but when I want to make a new assembly with different sizes and i rename it the code no longer works. As you said it probably is a static file name but I'm not sure how to make it dynamic. I could just be going about it in the wrong way so if you have any ideas I'm open to them. 

 

"Column Cutout Rule"
If
Parameter("iLogic Base Plate", "Column_Cutout") = False Constraint.IsActive("Flush:8") = False Constraint.IsActive("Mate:1") = True Parameter("iLogic Column", "Weep_Hole_From_Bottom")= 0 Else If Parameter("iLogic Base Plate", "Column_Cutout") = True Constraint.IsActive("Flush:8") = True Constraint.IsActive("Mate:1") = False Parameter("iLogic Column", "Weep_Hole_From_Bottom") = Parameter("iLogic Base Plate", "Thickness") - 1 / 4 End If  
"Sum of Weights Rule"
Total_Weight
= Parameter("iLogic Base Plate", "Weight") + Parameter("iLogic Column", "Weight") + Parameter("iLogic Top Plate", "Weight") + Parameter("iLogic Grounding Tab", "Weight") + Parameter("iLogic Bent Plate", "Weight") + Parameter("iLogic Stiffener Plate", "Weight")

 

Message 4 of 10
Curtis_Waguespack
in reply to: mBASOM

Hi @mBASOM ,

 

As mentioned, you will want to rename the components in the browser so that the occurrence name is "stabilized" and remains the same regardless of the file name change.

 

You can call them what ever you want, as long as they match the names in the code. A good way to know that they are renamed is to remove the colon and instance number from the name .

example : Grounding Tab:2  becomes Grounding Tab2

 

Also just as a tip, programming questions of this type are better placed on the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

aaa.png

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 5 of 10
mBASOM
in reply to: Curtis_Waguespack

Are you saying that I can change the file name and nothing else and that will solve my issue? Does changing the file name un-link those files so that if I make a change in one version of the part it won't affect the "standard" version? The way I've been doing it is copying the assembly and all of the parts and renaming them in the file explorer. But I figured you had to go and replace all of the files in the assembly with the renamed files.

Message 6 of 10
Curtis_Waguespack
in reply to: mBASOM


@mBASOM wrote:

Are you saying that I can change the file name and nothing else and that will solve my issue? Does changing the file name un-link those files so that if I make a change in one version of the part it won't affect the "standard" version? The way I've been doing it is copying the assembly and all of the parts and renaming them in the file explorer. But I figured you had to go and replace all of the files in the assembly with the renamed files.


Nope, I'm saying change the browser name (aka Display Name) and then make sure the code matches those names, then when you do change the file name during a copy from say, iLogic Grounding Tab.ipt to 999-31 GTab.ipt or something along those lines, the code will still work because it is looking at the browser name, and the browser name will be "stable" and not show the file name.

 

Also when you close all files you can find a tool called iLogic Copy Design, that will copy and rename the files for you, and then your new assembly file will be looking at the new named part files without you having to replace them manually.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

aaa.png

Message 7 of 10
philip1009
in reply to: mBASOM

Renaming the Occurrence names in your assembly browser does not affect the file names at all, and when you do a component replace or whatever else you do that Occurrence name will stay the same.  However if you delete that occurrence and place the same one back in or another similar part, then you'll have to rename it to work with your code.

 

What I've also done in the past is have the copy, replace, and edit functions in code so I only have to copy and rename the top level template assembly and everything else is done in code after filling out the iLogic form.

Message 8 of 10
mBASOM
in reply to: Curtis_Waguespack

Sorry you've been really helpful I just want to make sure I'm understanding this correctly. I did the save as and renamed the file in the file browser (circled in blue). So as long as I don't do anything to change the display name (circled in red) and the code matches the display name(circled in red) I can change the file name (circled in blue) and it will work like it's supposed to?

Capture.PNG

Message 9 of 10
Curtis_Waguespack
in reply to: mBASOM

Hi @mBASOM 

 

No need to apologize...

 

There is not really a need to rename the browser node in the part file, since the part rules are never looking at that. In fact I prefer to leave those alone (note to set them back you can edit them and just delete the name, and inventor will reset back to the file name, so you might want to do that)...

 

Where you want to have the browser names stabilized is in the assembly file. This is because the assembly rules must use the browser name  (aka "occurrence name" or " occurrence display name") to find the target file.

 

In this image I've named all the occurrences from inside the assembly, but if I looked that folder I'd see your original file names.... Once renamed, I just make sure the rules are looking at these name, and then I can copy the assembly and parts 1000 times and the rules still looks for Darryl or Bob, etc.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

aaa.png

Message 10 of 10
mBASOM
in reply to: Curtis_Waguespack

Ok, I understand now. I was thinking that whenever I replaced those parts with the new ones that I would need to change those names so that it wouldn't recall the template part. I see now that the assembly browser names don't change after being replaced but the file they're associated with changes. Thanks for your help!

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

Post to forums  

Autodesk Design & Make Report