iLogic display name in assembly

iLogic display name in assembly

Anonymous
Not applicable
1,535 Views
4 Replies
Message 1 of 5

iLogic display name in assembly

Anonymous
Not applicable

Hello, 

i have a problem with my iLogic rule for setting display name (name in tree) of part. 

It works great in a part, but if I place a part into an assembly, it doesn´t work. It doesn't work even when I open a part (the part is still into assembly). 

 

Thx for help

Capture.PNG

0 Likes
Accepted solutions (1)
1,536 Views
4 Replies
Replies (4)
Message 2 of 5

Sergio.D.Suárez
Mentor
Mentor

Sorry if I do not interpret you correctly. Do you try to change the displayname of a part from the assembly where the part is located?


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 5

Anonymous
Not applicable

Yes, but the rule is just in a part. 

0 Likes
Message 4 of 5

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

 

Dim oOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Component")
	If oOcc Is Nothing Then Exit Sub

Dim oDoc As Document = oOcc.Definition.Document

Dim oLUCY As String = oDoc.Componentdefinition.Parameters("LUCY").Value
Dim oL_R As String = oDoc.Componentdefinition.Parameters("L_R").Value

oDoc.DisplayName = oLUCY & "/" & oL_R

Hi, if you look at your part code image LUCY and L_R have a bluish color. Because ilogic is identifying that in that part file there is a parameter with that name and associates it directly with it.

When you are in an assembly you do not have those parameters. Those parameters are in the part. Then you have to access the part first and then define the part's parameter.
In the following code I share an example. You take an assembly, then you execute the rule. Now you select the part you want (the part must have the parameters LUCY and L_R respectively, if you do not have the parameters it will give an error because you will not find them) The code will change the display name as you have requested in the code.
Keep in mind that this will change the displayname of the part, it will not change the browser node, that is, its appearance in the browser.
I hope this helps greetings

Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks, works well.Robot wink

0 Likes