Problem with subassembly's in mainassembly (selction multivalue)

Problem with subassembly's in mainassembly (selction multivalue)

Anonymous
Not applicable
439 Views
5 Replies
Message 1 of 6

Problem with subassembly's in mainassembly (selction multivalue)

Anonymous
Not applicable
Hello,

i wrote the code below of this text. The function should be:
Slotkeuze is a multivalue parameter and selects the users input of Forty, Fifty or Sixt.
The user can make a selection.
In the assembly are three IAM-files, (Forty, Fifty and Sixty).
The problem is that if i run the rule two of the assembly's are deleted from the file.
I don't know why this happens, hopefully someone can explain me why this is happening.

Thanks, Joop

The code is:

If
SlotKeuze = "Forty" Then Dim componentA = Components.Add("Forty:1", "Forty.iam", position := Nothing, grounded := False, visible := True, appearance := Nothing) Components.Delete("Fifty:1") Components.Delete("Sixty:1") ElseIf SlotKeuze = "Fifty" Then Dim componentA = Components.Add("Fifty:1", "Fifty.iam", position := Nothing, grounded := False, visible := True, appearance := Nothing) Components.Delete("Forty:1") Components.Delete("Sixty:1") ElseIf SlotKeuze = "Sixty" Then Dim componentA = Components.Add("Sixty:1", "Sixty.iam", position := Nothing, grounded := False, visible := True, appearance := Nothing) Components.Delete("Forty:1") Components.Delete("Fifty:1") End If
0 Likes
440 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

I'm not sure what you are asking.  It looks like your code is designed so that, when you select one of the three available options, it will add the selected sub-assembly to the main assembly, then delete the other two sub-assemblies from the main assembly.  If you don't want it to delete the other two sub-assemblies, just delete the two lines of code following the Add line for each iteration of the If statement.  Or do you want to Suppress the other two sub-assemblies, instead of delete them?

What exactly are you trying to do?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

Anonymous
Not applicable

WCrihfield,  

 

I had a good think About the code i made and your comments.

the assembly will be Placed in the inventor library so delete of none chosen subassembly’s is not the right option. The two options that are not chosen have be available in case i have to switch the one of the other options. So i Will have to supress those options.

0 Likes
Message 4 of 6

dutt.thakar
Collaborator
Collaborator

@Anonymous 

If you are putting these assemblies in library folder and always want to reuse them based on selection, I think it is good to delete them from the Inventor assembly rather than suppressing them because when you suppress them you will have to create a custom Level of detail, also You need to do a workaround to get the right bill on materials if you suppress, if you simple use delete (just like you have now) it will show right BOM without any workaround.

 

Another thing, just to note, when you use Component.Delete("Forty:1") as you have now, it will just delete that from Inventor assembly and not from your library folder, but whenever it has to add it, it will automatically add in the assembly from the same path.

 

In my opinion, I would recommend if you are always going to reuse these three assemblies, in all the designs, make sure you use the delete workflow (It is called managing components in iLogic) and not suppress them.

 

Hope this will be helpful. Please shout out in case you have any more confusion.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 5 of 6

Anonymous
Not applicable

@Anonymous.Catar, 

Ween the assembly is placed in the library and will be placed in a project then i alwaar want to have the option to chosen fifty op sixty ween i at time of placememt i die chosen for forty.

And the Bill of materials should also reflect the name of the chosen option.

so in other Words if i placed the assembly in the library then the options Will not be delete after placement and selection? Now i am understanding why the two options i did not chose were deleted.

is it always necessary to make a level of detail if you are using ilogic?

if i want to Place subassembly’s (which have ruilen and a from) in the main assembly, is it possible to use these rules in the main assembly? And how Can i call them info the main assembly?

 

 

0 Likes
Message 6 of 6

dutt.thakar
Collaborator
Collaborator

@Anonymous 

 

I am barely able to understand what you are trying to say, please try to convey clearly what you are trying to achieve.

Whatever I understand I will try to answer

 

First of all, it is not necessary to create a level of details whenever you are planning to use iLogic, if you are thinking to suppress any components inside the assembly, either with iLogic or without it you will be forced by Inventor to create it, so in case of suppression yes it is mandatory.  so if you are copying the assemblies forty, fifty, and sixty, in each of your projects in different folders then, you can place all three at once, and use suppress with ilogic based on your selection, and for that, you need to create a Level of detail. If you want to use suppress you can use Component.IsActive("Forty:1") = True/False instead of Component.Delete. In this approach, if you want your BOM just to show the one that is selected, you either need to change its BOM Structure to reference or you can create a View representation and use it for correct BOM because suppression always refers to the only MASTER level of detail in BOM.

 

On the other hand assume that you have these assemblies, Forty, fifty, and sixty and you are saving them in one location, and for each project you always use them from these parts (it means you are not copying them for a new project, you always use them from the same location), in that case, you do not need a level of detail, because what you have now will work properly and they will always be placed from the same path based on your selection and always show correct BOM.

 

I hope this makes it a bit more clear.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes