Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I have just started working on incorporating the Top down design apporach in our design.
I would like to share a error which I came across working in Interchange assembly Pro/Program.
Issue:
I have an main assembly "SMK0001.ASM" in which I have an sub-asembly named "SMK0002XXX1.asm" which is a family table component of generic named "SMK0002XXXX.asm"
Now I need to replace "SMK0002XXX1.asm" with its other instance named " SMK0002XXX2.asm". it is possible for me to replace those by replace option in GUI.
But when I tried to make it as pro/program i am getting an error message as follows
" ERR: the model to be added is non-existent or not interchangeable".
Please someone Guide me how to achieve the same. since we need this feature to be used in our design approach in many places.
Regards,
Manikandan S.
Please include the segment of the Program that you are using to make this change.
INPUT
D STRING
"WHAT IS THE DEPTH?"
END INPUT
RELATIONS
IF D == "SEVEN"
COMP = "SMK0002XXX1.ASM"
ELSE
IF D == "NINE"
COMP = "SMK0002XXX2.ASM"
ENDIF
ENDIF
END RELATIONS
.
.
.
.
ADD COMPONENT (COMP)
INTERNAL COMPONENT ID 66
PARENTS = 60(#6)
END ADD
!*** ERR: the model to be added is non-existent or not interchangeable
ADD COMPONENT (COMP)
INTERNAL COMPONENT ID 69
PARENTS = 60(#6)
END ADD
!*** ERR: the model to be added is non-existent or not interchangeable
I don't see a type for COMP, for example COMP STRING.
In the docs I see that ADD COMPONENT is for changing the type of item, substituting a .prt for .asm.
If it is the same type, use ADD PART () It may not need the type extension in COMP because it is a family table item, the software already knows what type it is and may be reading this as "SMK0002XXX2.ASM.ASM"
Thank you david,
I tried what you have suggested but, it ain't working...
I have taken these program segment from ptc community only.
Try the same thing with an assembly that contains only SMK0002XXXX.asm. Less to interfere.
Also, try setting COMP = "SMK0002XXXX.ASM" before the IF statement. This prevents the logic failing to chose one of them, leaving COMP == "" which will fail.
Again, I notice the examples don't use the filetype suffix, just SMK0002XXXX. It's a family table; the software already knows the type.
Now I have tried to replace the components with the next sub-assembly "SMK0002XXXX.ASM" in which I have a family table component "700Depth" and a "bracket". Now I want to replace the "700Depth" with its family table compoent "900Depth"
Even I havetried to assign COMP = "700DEPTH" and Just want to add the component but still Iam getting the same error. as I got earlier.
INPUT
D STRING
"WHAT IS THE DEPTH?"
END INPUT
RELATIONS
END Relations
.
.
.
.
COMP = "700Depth"
ADD COMPONENT (FAM)
INTERNAL COMPONENT ID 59
END ADD
!*** ERR: the model to be added is non-existent or not interchangeable
ADD PART BRACKET
INTERNAL COMPONENT ID 60
END ADD
MASSPROP
END MASSPROP
---
Manikandan S
You did not define a value for FAM.
Sorry, I replaced "FAM" with "COMP" even then I am getting the same error.
COMP = "700Depth"
ADD COMPONENT (COMP)
INTERNAL COMPONENT ID 59
END ADD
!*** ERR: the model to be added is non-existent or not interchangeable
ADD PART BRACKET
INTERNAL COMPONENT ID 60
END ADD
MASSPROP
END MASSPROP
When using COMPONENT you must use the extension, when using PART you don't use the extension. I just found that in my notes.
I also think the string needs to be all upper case: COMP = "700DEPTH.ASM" ?
I guess that 700DEPTH is an instance of SMK0002XXXX.ASM assembly? I can't tell which level you are working with.
Please find the images hope which willhelp you to understand
At first glance, the Pro/PROGRAM syntax looks good. (Sometimes people put IF blocks around the ADD COMPONENT.... but the way you are doing it with (COMP) is acceptable.
I would look at how you defined the interchange asm. I am confused as to why you have an interchange asm. Are "SMK0002XXX1.asm" and "SMK0002XXX2.asm" both family table instances of the generic "SMK0002XXXX.asm"? If so, then you don't need an interchange asm to interchange these instances. (Provided the assembly constraints use references that are in both instances - which is usually the case, but should be checked.) If the instances you are interchanged do not share the same references, then you would need to create an interchange asm and define interfaces that are equivalent in each of the interchange asm's components. Then you need to make sure the asm that uses these interchange components only assembles them using the interfaces you defined in the interchange asm. (If you haven't defined the equivalent interfaces and/or did not assemble them with the common equivalent interfaces, then you'd get an error message like you are.)
That's what I would focus on... if you are still stuck, it might be good to open a call with tech support and ask them to review a simple case. It's likely there is just a small misunderstanding on how to set things up.
Darcy
The "SMK0002XXX1" & "SMK0002XXX1" are instances of generic component "SMK0002XXXX" which shares the same reference only. I need to replace those components according my input. So, only I used this code.
But with this I am getting that error.
How is "700DEPTH.PRT" related to "SMK0002XXX1" & "SMK0002XXX1"? By your description I would expect "SMK0002XXX1" & "SMK0002XXX1" to be interchangeable.
If "700DEPTH.PRT" is a subcomponent of "SMK0002XXX1" & "SMK0002XXX1" then you need to write the pro/program in "SMK0002XXXX". So you would have Pro/Programs in your top level assembly that would drive things including driving another Pro/PROGRAM in your subcomponent "SMK0002XXXX" which would in turn drive the interchange of "700DEPTH.PRT" and "900DEPTH.PRT".
Investigating syntax issues is usually a good idea... but in this case, the error message seems to be more about "700DEPTH.PRT" - which if I understand things correctly is not a direct subcomponent of your top level asm. Its actually a subcomponent of one of the top level asm's components (or further down). "700 DEPTH.PRT" was a typo I see... but it is also not directly in the top level asm either... so fixing the syntax error didn't help.
Can you flatten your asm structure? This might make the logic simpler because you could flatten it such that there is no need to think about the flow of the Pro/PROGRAM's to the subcomponents.
If you need to keep the asm structure... then have a look at the Pro/PROGRAM "EXECUTE" command to pass parameters down to the sub components.
Darcy,
Following is the structure of the assembly for the very first syntax with which this discussion was started.
which has a sub-assembly named "SMK0002XXX1.ASM" and "REAR_WIDTHWISE.PRT".
In that I wrote a syntax to replace the component "SMK0002XXX1.ASM" with " SMK0002XXX2.ASM". But I ended up with the mentioned error.
To Simplify the problem I have taken the sub-assembly "SMK0002XXXX.ASM" in which "900DEPTH.PRT" has to be replaced by "700DEPTH.PRT"
Even then I'm getting the same error..
----
Manikandan S
Hi Manikandan,
Thanks for the clarifications. There are many details that are difficult to follow for me. I think your best bet is to contact someone in PTC Technical Support and share your models.
The only thing I can see is that you won't be able to interchange "900DEPTH.PRT" directly from "SMK0001.ASM". (This is why I think you are getting the error.) You must control it from a separate Pro/PROGRAM in "SMK0002XXX1.ASM". The top level "SMK0001.ASM" can pass parameters down to "SMK0002XXX1.ASM" using the "EXECUTE" command. (If you haven't already, read about "EXECUTE" in the Pro/PROGRAM docs... It is necessary given the nested structure of your assembly and the fact that you are trying to interchange components further down.)
Also, because "SMK0002XXX1.ASM" is a family table generic, you'll probably want to investigate the "LOOKUP_INST()" function and the "INSTANTIATE" command if the instance with the desired subcomponent does not exist yet.
Darcy
700DEPTH is a part, so use "700DEPTH.PRT"
I have changed the code as "700DEPTH.PRT". but still it shows the same error
What did the section look like before you editted it?
I also noticed you had used "700 DEPTH" with a " " and not "700DEPTH"
Yes you are right in earlier case I did that mistake but I have corrected that. Then also it is showing the same error
We use PRO/Program, Interchange Assemblies and Family Tables in all our models, so maybe I can help.
As others have said, when you are working with a Family Table and you want to swap instances, you can use the ADD PART (NAME_OF_INSTANCE) or ADD ASSEMBLY (NAME_OF_INSTANCE). If the FT is an assembly, use ADD ASSEMBLY, if your FT is a part, use ADD PART.
If you are using a Interchange Assembly, you could also use ADD PART or ADD ASSEMBLY if all "instances" of the Interchange Assembly are parts or assemblies. But when you have a mixture of parts and assemblies in your Interchange Assembly, you should use ADD COMPONENT (NAME_OF_INSTANCE_WITH_EXTENSION)
Make sure that the constraints can resolve when you swap the components.
Then there's the EXECUTE PART, EXECUTE ASSEMBLY (and EXECUTE COMPONENT) stuff. Honestly we don't use that on our FT and Interchange Assemblies (they don't have any INPUT parameters) because they are "library components" which are used in multiple projects. We only select which component from the FT of Interchange Assembly we want to use with PRO/Program. We do use the execute statements to drive the sub-components of our assemblies (width and height for example).
Tip: put all your formulas and calculations in the RELATIONS section of your assembly. That section is always accessible to your users.