Copy-design breaks iLogic rules - overriding component name doesn't fix

Copy-design breaks iLogic rules - overriding component name doesn't fix

paul.mcnam
Enthusiast Enthusiast
1,734 Views
9 Replies
Message 1 of 10

Copy-design breaks iLogic rules - overriding component name doesn't fix

paul.mcnam
Enthusiast
Enthusiast

I'm using "Component.IsActive" to suppress parts in a table driven assembly.

Everything works beautifully until I copy design in Vault and change the component names as it doesn't update the part number in the iLogic coding.

 

I've read the solution in a few topics here is to rename the components in the tree once, which "freezes" them.

That part worked, I did a test with CYL.iam comprised of just, CYL1.ipt and CYL2.ipt, and renamed them to CYLx.iam, CYL1x.ipt and CYL2x.ipt.

After closing Inventor and reopening to avoid confusion with loaded part numbers, i opened the CYLx assembly and the component tree showed the origianl component names (so without the x added).

Changing the excel sheet to suppress one part succesfully supressed the part, but as soon as i press save in the inventor assembly, i get the error message

"The component name was not found"

It's staring right at me in the face so i don't see what the problem is.

I've also tried unchecking the box "update part numbers" in Copy Design but I still get the same error.

What's going on here, why does this work for others but not me?

Cheers

Paul

 

supression.jpg

 

 

0 Likes
Accepted solutions (1)
1,735 Views
9 Replies
Replies (9)
Message 2 of 10

johnsonshiue
Community Manager
Community Manager

Hi Paul,

 

When you did Copy Design, were there suppressed components? if yes, it might explain the behavior you are seeing. When a component is suppressed, the document is unloaded from memory. And, the link between the assembly and the suppressed component is temporarily suspended. As a result, Copy Design is not able to replace the suppressed component with another suppressed component. Although the top level assembly has been saved as a different file, the suppressed component remains unchanged. When you unsuppress it, Inventor will load the old component or prompt to resolve if not found.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 10

paul.mcnam
Enthusiast
Enthusiast

Hi Johnson,

 

Thanks for responding.

 

No, both parts were active.

I made sure of this and made another copy to a different directory in case that was causing conflict but it still did not work.

It's so bizarre how it knows to suppress either part when you change the excel to suppress, but as soon as you try put it back or save it, it wonders where the part is. Seems like a bug but unsure why only I'm experiencing it. I'm on professional 2017.4

 

I've attached two zip files, one with the original files which works smoothly with the spreadsheet, and one with a copy from Copy Design using Vault.

 

Losing faith here Smiley Frustrated

 

EDIT: Also, if i just right click on the suppressed part and un-suppress, it comes back. So it's not like it can't find the file as it does find it again when I instruct it using the tree. It seems to be something confused in the background.

0 Likes
Message 4 of 10

paul.mcnam
Enthusiast
Enthusiast

I tested on the uploaded zip file I just gave.

As the assembly was still referencing parts from the location i zipped them from, i had to do a component replace, and after doing that the supersession worked properly, so playing with that won't let you experience the same problem as me.

I think the only chance of you experiencing the same problem as me is by having it all set up working, and then Copy Design in your own Vault 😕

0 Likes
Message 5 of 10

johnsonshiue
Community Manager
Community Manager

Hi Paul,

 

I see the issue now. The problem here is that the copied files still carry the old Part Numbers. I thought Vault Copy Design allows you to update the PN, right? Did you select the option? Also, you may want to disable iLogic Add-In when you do the copy and activate LOD:Master. Having another process running while making a hard copy can be more confusing. After the copy,  the browser names in the copied assembly may still appear outdated. You can use Rename Browser Node command to update the browser names. I am sorry that the process is not intuitive. It should have been more straight forward. Could you try it and let me know if it works better?

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 6 of 10

paul.mcnam
Enthusiast
Enthusiast

Nope, I originally checked the Update Part Numbers box, and that didn't work.

I tried it again with part numbers updated, and it still doesn't fix the issue.

 

I'm not sure how I disable iLogic addin?

I saved the original file in Master LOD, and disabled the event trigger that runs the rule before save, made a copy design through Vault and I'm still getting the exact same error.

0 Likes
Message 7 of 10

paul.mcnam
Enthusiast
Enthusiast

I started again from scratch, making two parts named Square and Circle. Put together in "Assembly" with excel sheet Assembly.xlsx

I copy designed it and added letter B to each file name.

 

This time it works a little better. The first component, which was grounded, my "Square" can be switched on and off using the spreadsheet smoothly. 

(I've also noticed i don't need an event trigger for this to work)

However if I try to suppress the second component, the "Circle", it suppresses as per usual however when try unsuppress by changing value from 0 to 1, it gets the same error.

So before I was getting the error with both components, now i'm just getting it with one.

The only thing I changed was the names (took off any numbers in case that was causing confusion), and also the Parameters in the excel sheet I used a different name to the component name to avoid any confusion. 

 

Here is what i get from the "More Info" tab when the error appears:

 

System.ArgumentException: Component: The component named "Circle:1" was not found.
at iLogic.ComponentInRule.FindComponents(Object componentName, Boolean topLevelOnly, Boolean inTopLevelContext)
at iLogic.ComponentInRule.set_IsActive(Object componentName, Boolean valb)
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

Does that shed any light?

0 Likes
Message 8 of 10

paul.mcnam
Enthusiast
Enthusiast

I've attached the last trial in a pack and go where only one of the two components can be suppressed, so you can experience the error for yourself.

 

Cheers

 

Paul

0 Likes
Message 9 of 10

paul.mcnam
Enthusiast
Enthusiast
Accepted solution

Ok I have fixed it!!!!!!!!!

I renamed the component names in the main assembly tree and it seemed to fix it.

I was originally renaming the component name by opening up the individual parts (which still allowed it to stay frozen after the renamed copy design), whereas I should have just done the renaming in the assembly tree.

This means that even though my part names stayed the same after a copy design - making everything seem like it should work, in the top level assembly file, the component names in the assembly tree were linked to the component names for the parts. So I needed to properly rename them in the assembly tree to "freeze" them to avoid it confusing itself.

Certainly not intuitive, but I think I've resolved it.

0 Likes
Message 10 of 10

Anonymous
Not applicable

Hi, Paul and Join

I have a problem when I place an Ilogic assembly (i will call it is A) into another larger assembly (Call it is B) which contains A.

When A was placed into B, A became A-01, A-02, A-03...

and my screen show:

          "Error in rule: Rule0, in document: Assembly1-01.iam

           Parameter: The component named "Part1:1" was not found."

Explain the symbols and names:

"Rule0": is the name of the rule.

"Assembly1.iam ": is the name of an ilogic assembly file

"Assembly1-01.iam" : is the name of the ilogic assembly file after it was placed into a larger assembly

"Part1:1": is the name of the first component inside "Assembly1.iam "

 

Could you please help me fix it? or could you please show me what I need to do when I place an ilogic assembly into another assembly?

this is the picture

11.JPG

 

and this is the name after "place ilogic component" of "Assembly1"

111e.JPG

and this is the code i wrote

"

Parameter("Part1:1", "d2") = height
Parameter("Part2:1", "d2") = wide
space = height/soluong
If height > 500 Then height = 500 ElseIf height <500 Then height = 400 ElseIf height <400 Then height = 300 ElseIf height <300 Then height = 200 Else height =200 End If
If soluong = 1 Then Component.IsActive("Part2:5") = False Component.IsActive("Part2:4") = False Component.IsActive("Part2:3") = False Component.IsActive("Part2:2") = False ElseIf soluong = 2 Then Component.IsActive("Part2:5") = False Component.IsActive("Part2:4") = False Component.IsActive("Part2:3") = False Component.IsActive("Part2:2") = True ElseIf soluong = 3 Then Component.IsActive("Part2:5") = False Component.IsActive("Part2:4") = False Component.IsActive("Part2:3") = True Component.IsActive("Part2:2") = True ElseIf soluong = 4 Then Component.IsActive("Part2:5") = False Component.IsActive("Part2:4") = True Component.IsActive("Part2:3") = True Component.IsActive("Part2:2") = True ElseIf soluong = 5 Then Component.IsActive("Part2:5") = True Component.IsActive("Part2:4") = True Component.IsActive("Part2:3") = True Component.IsActive("Part2:2") = True End If
iLogicVb.UpdateWhenDone = True"
0 Likes