Skip to main content
1-Visitor
January 13, 2022
Question

ProCableCosmeticFeatureCreate()

  • January 13, 2022
  • 1 reply
  • 2525 views

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.

1 reply

RPN
18-Opal
January 13, 2022
  • Is the ProArray size greater 0.
  • proCableLocations[0]

Joey1-VisitorAuthor
1-Visitor
January 14, 2022

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
18-Opal
January 14, 2022

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?