cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

ProCableCosmeticFeatureCreate()

Joey
7-Bedrock

ProCableCosmeticFeatureCreate()

Hello,

Has anyone experience using the ProCableCosmeticFeatureCreate() function in Pro Toolkit? 

cable.ParentAsm.ProAssemblyHandle = a assembly that holds an existing cable.

cable.ProCableHandle = a cable inside a harness

 

Running:

 

ProCablelocation* proCableLocations;
ProFeature cosmeticCable;
ProSelection selection;

ProCableLocationsCollect(cable.ParentAsm.ProAssemblyHandle, &cable.ProCableHandle, &proCableLocations);
ProSelectionAlloc(NULL, proCableLocations, &selection);
ProCableCosmeticFeatureCreate(ProCableCosmeticType::PRO_CABLECOSMTYPE_TAPE, selection, L"TapeBundle", L"TapeSpool", &cosmeticCable);

 

 

I'm getting this error:

PRO_TK_INVALID_TYPE The type of the reference selection is not valid for the type of cosmetic feature to be created.

 

I've tried different combinations but cant get it to work.

5 REPLIES 5
RPN
17-Peridot
17-Peridot
(To:Joey)

  • Is the ProArray size greater 0.
  • proCableLocations[0]

Joey
7-Bedrock
(To:RPN)

Yes, it contains 4 location points taken from the cable. 

The pro toolkit documentation states " The selected cable location or cable segment point to use for the feature creation." making it sound like one cable location should suffice. But should it not be able to create a cosmetic between two location points?

 

Regarding the feature name and spool name, will this ProCableCosmeticFeatureCreate() create both a tape feature and spool or should there exist a spool for it to use?

RPN
17-Peridot
17-Peridot
(To:Joey)

Ok, but 

&proCableLocations

is a model item array, not a single one, as expected during selection allocate.

 

It’s valid afik 

ProCableCosmeticFeatureCreate(ProCableCosmeticType::PRO_CABLECOSMTYPE_TAPE,…


but did you try ( I do it always like this):

 

ProCableCosmeticFeatureCreate(PRO_CABLECOSMTYPE_TAPE,…

 

this?

 

Joey
7-Bedrock
(To:RPN)

I tried:

ProErrorNotOk(ProSelectionAlloc(NULL, proCableLocations[1], &selection), "Unable to select cable location");

ProErrorNotOk(ProSelectionAlloc(NULL, proCableLocations, &selection), "Unable to select cable location");

with not luck.

Using PRO_CABLECOSMTYPE_TAPE did also not change the outcome.  

 

Thank you for the feedback!

 

YaroslavSin
17-Peridot
(To:Joey)

1. Use proCableLocations[1], as mentioned early and as expected during selection allocate

2. Try to put component path to ProSelectionAlloc. The path to the component where a cable location is.

3. I think, need to use the name of existing spool.

Announcements


Top Tags