Getting filename after copy

Getting filename after copy

David_G_Rodriguez
Enthusiast Enthusiast
291 Views
4 Replies
Message 1 of 5

Getting filename after copy

David_G_Rodriguez
Enthusiast
Enthusiast

I am trying to push parameters from an assembly to a part.

 

I use the following code:

 

Parameter("3 Drawer Stack.ipt", "fin_end_switch") = use_fin_end

This works fine, except we use a 3rd party software to insert these assemblies into other assemblies and when this happens it changes the filename so the parameter no longer works.

 

Is there a way I can get the filename to update after the filename changes?

 

All I am trying to do is to not have to open the multipart file every time I want to make a change in the assembly. I was happy when I figured out the parameter function, but unfortunately it breaks when the filename changes after copy.

 

If I could somehow have the part name get the new file name and set that as a string that I could refer to in the parameter code, that would work. 

 

I'm just now learning all of this iLogic, I apologize if this is basic knowledge.

0 Likes
292 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

....

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

A.Acheson
Mentor
Mentor

You should stabilize the occurrence name  within the assembly. Simply rename occurrence to a generic name. Then you can copy the files and the parameter is linked to the stabilized names and the references are changed in the background. Depending on how the copying of the files is done. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 5

David_G_Rodriguez
Enthusiast
Enthusiast

I'm referencing a parameter in a multipart file, .ipt.

 

Don't I need to put the filename in the parameter update command?

 

Parameter("K4-C5_3 Drawer Stack0101.ipt", "fin_end_switch") = use_fin_end
 

 

So the problem I have is that the filename of the .ipt changes when our other program inserts the file, because it changes the filename. Is there a way to use that code without the filename?

 

0 Likes
Message 5 of 5

A.Acheson
Mentor
Mentor

See second paragraph of this article. Component/occurrence name used instead of file name. See article on occurrence browser nodes/occurrences name stabilization 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes