Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello all,
I want to know how to define ProAsmComppath used in ProSelectionAlloc for a feature in skeleton used in assembly.
I have feature ID for skeleton as 98 and in this skeleton I have a feature whose path I want to add has feature ID 3560. I saw in knowledge hub mentioned the method as {98,3560}. But when I try in ProSelectionAlloc to mention this way. It shows error
How do I mention correct path in ProSelectionAlloc ().
Thank You.
Hi @Sss4598,.
Thank you for your question!
I’d like to recommend to bring more details and context to your initial inquiry.
It also helps to have screenshot(s) to better understand what you are trying to do in your process.
Please refer to this guideline to make your questions more likely to receive a quick and useful answer.
This will increase your chances to receive meaningful help from other Community members.
Furthermore, please consult this Community Search guideline as well, which boosts up your chances of finding a resolution to your topic(s) much faster, as well as making use of our Knowledge Base.
Thank you for your participation and please let me know if you need further assistance!
Best regards,
A component path is just a list/array of component identifiers from the Root Assembly to the selected component. You need to tell toolkit which level/depth and the identifier. This will enable you to uniquely identify a component in an assembly (max level is 32) even if you have the same component more than once in one level.
The path and/plus the model item together is is always unique. The model item alone may not.
The model item owner must be the same model as specified with your path down.
If you assemble a part, then for this component the path is not needed, this is true as well on assembling an Assembly and you specify model items, like an axis from this assembly.
In most other cases you need to deal with the path.
If you allocate a selection make sure the path match if you specify a model item as well.
Hi,
Can you please provide me correct syntax to provide path to my datum point feature in skeleton as when I give it as an array of feature IDs {skeleton ID, datum feature ID}. It shows error type int incompatible with ProAsmComppath.
Try to learn and copy from working code: lookup the function ProSelectionAlloc() the PTC TOOLKIT API Wizard and see one of the over 100 examples below "Sample Code References:". Near the call to ProSelectionAlloc(), the argument ProAsmcomppath will be prepared in a proper manner.
For example, call ProAsmcomppathInit().
If you can select a modelitem (datum point feature) interactivly, it always (?) can be done via Pro/TOOLKIT, too.
For some cases (and this one I do not remember clearly), the feature ID in the Creo model tree is off by (+ or -) one, compared to the internal feature IDs in Pro/TOOLKIT ProFeature handles.
So you might construct your ProAsmcomppath technically correct with a fixed feature ID as input, but the ID is one off, thus invalid.
To avoid this: A) try your ID +/-1 or B) reveal the correct, TOOLKIT internal feature ID the other way around: use an existing ProSelection (interactively created of the feature in question) -> get the ID of the selected feature.
Again: I'm not too sure about this feature-ID-off-by-one thing.
ProAsmcomppath should contain only components ids, not feature ids. In your case, assuming one-level assembly, the construct should be :
ProIdTable tt;
tt[0]=98;
tt[1]=-1;
//or ProIdTable ttt{98,-1};
ProAsmcomppathInit( asm, tt, 1, &cpath);
a word of warning - quite often selecting a feature won't do anything useful - most likely you would need to descend into feature's geometry and get a ProGeomitem and use it in ProSelection