Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Good afternoon i'm using a creo parametric 11 version, i'm trying for my drawing to populate the "code nr." and some other parameter as shown below automatically.
For example a code can be "202500001_11" i want to manually apply che 202500001 code only on the main .asm parameter and use the same code also in all the .prt drawing on the repeat region.
Actually i write this code on the relation of all the .prt
DESCRIZIONE_ORDINE=DESCRIZIONE_ORDINE:1
NOME_PARTICOLARE=rel_model_name
DISEGNATO=DISEGNATO:1
ORDINE=ORDINE:1
CODICE=CODICE:1
DATA_CREAZIONE=DATA_CREAZIONE:1
QNT=QNT:1
And it works, but i cannot save this code in the start part of the .prt because of that ":1" that refer to the .asm and it does not exist in the new .prt.
for the "_11" i'm using matching code like this and it workd perfectly also on the start part
IF rel_model_name=="CAV_M"
NR_PARTE="_11M"
Can someone help me with the main code ?
Thank you for your time and help.
Solved! Go to Solution.
Okay you would like to change part numbers based on a common prefix, I guess, you know that this may dangerous 🧐 But anyhow, how are the filenames of this components. Personally I would like to derive the prefix based on the filename, here you can use a parameter within the relation.
If you stick to a common block like parameter, thing about to use a designated layout/notebook. But in this case you have to deal with reassigning the referenced layout at the beginning or if you copy a project, but for all members you can drive the numbering prefix at one spot, like you do with ‚aaa:xx‘
Whenever I want to assign values or parameters to the components of an assembly, I do so by passing the values from the assembly, not by using assembly parameters in the part. The part does not have any stored information in it that designates the assembly it belongs to. In fact, a part could belong to multiple assemblies. The part doesn't "know" it is in an assembly. The session ID, the ":1" you are using, is assigned to the assembly based upon what order it was loaded into memory. ":1" is the first, the next will be assigned ":3", etc. Odd numbers for assemblies, even numbers for parts.
Putting relations in start parts that reference assembly session IDs is not going to work, unless you happen to have an assembly with that session ID in memory. But even then, it probably won't work like you hope it will.
I really don't understand exactly what you want to do, here.
Thank you for your support,
as shown in the picture attached,in the drawing of every components i want to use, for the parameters highlighted in red, the same parameters used in the assembly.
It is possibile ?
Okay you would like to change part numbers based on a common prefix, I guess, you know that this may dangerous 🧐 But anyhow, how are the filenames of this components. Personally I would like to derive the prefix based on the filename, here you can use a parameter within the relation.
If you stick to a common block like parameter, thing about to use a designated layout/notebook. But in this case you have to deal with reassigning the referenced layout at the beginning or if you copy a project, but for all members you can drive the numbering prefix at one spot, like you do with ‚aaa:xx‘
If you want to use a parameter from the assembly to set parameters in the components of the assembly, you use relations in the assembly to pass the value down to the components. For example, if I have a parameter in my assembly called "Description2" that I want to be the same in my components, I need relations in the assembly that look like:
/*
/* Use Description2 from assembly to set Description2 in components.
/*
Description2:2 = Description2
Description2:10 = Description2
Description2:12 = Description2
Note that the relations in the assembly do not include a session ID for the assembly parameters. I suppose you could, but doing so is unnecessary.
If the parameter in the component is supposed to be more than just a copy of the assembly parameter, you can add the other parameters or strings to build it up, like
Description2:4 = Description2 + ", " + DrawingNumber
By doing things this way, you make sure the session IDs for the components are correct, check that all the settings worked like you want, and save the assembly. If you leave Creo and re-open the assembly, the session IDs might all be different in that session, but the assembly will handle things for you and all the relations will still work exactly the same. Creo "knows" what component the session ID was assigned to in the saved assembly and will switch it to the new session IDs when necessary.
Trying to go the other way and pull values from the assembly will only work if by chance the session ID of the assembly in a new session is the same as it was when you created the relations in the components. An invalid method.
For this type off stuff even an assembly is not required. Create a component, setup your parameters here, get the run time ID and use this ID, to copy or link this parameter to a different model.
On save the model name is used, during your session only the ID. Reference handling is done by Creo. On open the model name handle is replaced by the reference Model ID. It is just a simple mapping, and the reason that this ID may change from session to session.
Something like a Layout for poors😉
Question, though. Will this work if the part/assembly thus referenced isn't in memory when you open the component with the relations in it? I'd guess that relation will fail, but will that cause troubles? Does a failed relation cause evaluation of relations to stop, thereby not executing any relations defined after the failed one?
The model will have a dependency to the linked model, this model should be opened upfront and automatically by Creo due to this external reference.
Creo does not open referenced parts automatically.
If you open an part that has external references you get a statement of the form:
WARNING: External reference not present, placement frozen (feat id: 234).
To my recollection, it has always been thus.
Ok so you suggest to do the opposite i've done, refer the parameter of the assembly to the component.
Thank you for your advice.
Hello @AC_9932786,
Looks like you have some responses from our community experts. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.
I solve the problem with the help of both RPN and KenFarley.
