Skip to main content
1-Visitor
Jan 13, 2022 12:40 PM UTC
Question

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

RPN
18-Opal
Jan 13, 2022 10:13 PM UTC
  • Is the ProArray size greater 0.
  • proCableLocations[0]

Translate
Joey1-VisitorAuthor
1-Visitor
Jan 14, 2022 7:28 AM UTC

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?

Translate
RPN
18-Opal
Jan 14, 2022 6:29 PM UTC

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?

 

Translate