The PTC Community email address has changed to firstname.lastname@example.org. Learn more.
Interactive Creo can specify simplified rep on assembly sub-component instance.
+ Sub-Component A (Simprep on)
+ Sub-Component A (No Simprep)
+ Sub-Component B
PTC support confirmed there is no API to retrieve simplified rep on an assembly sub-component instance.
Please implement API.
Wouldn't ProMdlRepresentationLoad or ProMdlRepresentationFiletypeLoad do the trick? You would need to know the model's simprep before loading it... but I think you would need to know that also via your implementation, right? One of the arguments is ProSimprepData... so you should be able to set the status of the sub-components using that?
I haven't tested this at all... and I certainly have my doubts that it would work (you would need to know the Asmcomppath of the components PRIOR to opening the model)... but it may help.
One idea that may work - you could try loading it with "default exclude all", and then loading the desired components from there.
Thank you for the suggestion.
Your suggestion seems setting simprep on a sub component.
If I am wrong, please tell me so.
I am not setting the simprep.
I do not have simprep information. I believe there is an API to get simprep on the top assembly.
What I need is simprep information of a sub component of loaded model, and as far as I understand there is no API.
Ah Okay - I think I see what you are saying now.
You aren't necessarily looking for "saved" simp reps- you're looking to see if a sub-model is using a "user-defined rep".
In theory, you could use "ProSimprepDataGet" on your top model. That returns a "ProSimprepData" object, which contains an array of "ProSimprepItem" objects.
In theory, you could loop through that array of "items", and compare the "ProSimprepItemPath" to the "ProAsmcomppath" of your desired sub-assembly - however, that would only tell you the "state" of that sub-item - you can't tell if the sub-assembly is set to a specific "named" or "saved" simplified rep.
I have the same problem. Given a sub-assembly, I need to determine its active simplified representation. I am going to try dumping the fully expanded model tree to a text file using a macro. I can then parse this file to determine the active simplified representation for any given sub-assembly. I can then list all the IPFCSolid models for the session and use the file name to correlate the simplified representations with the IPFCAssembly model objects. Of course, this would be much easier if Creo provided API access to the model tree.
This is an ugly workaround, however, I think it might work. I opened a hotline case with PTC, they are going to try and formulate a workaround as well.
We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.
You can always post a new idea with all the details required in the form.
Thank you for your participation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.