I am attempting to attach additional data to entities in a STEP file and am having trouble. From an earlier suggestion I have tried writing code that uses AddWithRefs(), but I always get a, "Nothing to write", error. Here is some code that I used to see if I could attach the text: "SYS_LVL" as a unique entity that refers back to a part:
Handle(Transfer_FinderProcess) findProc = writer.WS()->TransferWriter()->FinderProcess();
IFSelect_ReturnStatus status = writer.Transfer( assembly->getShape(), STEPControlStd_AsIs );
Handle(TransferBRep_ShapeMapper) mapper =
TransferBRep::ShapeMapper( findProc, assembly->getShape() );
Handle(StepVisual_TextLiteral) sysLevelPart = new StepVisual_TextLiteral();
Handle( TCollection_HAsciiString ) sysLvlName =
new TCollection_HAsciiString( "SYS_LVL" );
sysLevelPart->SetName( sysLvlName );
writer.Model()->AddWithRefs( sysLevelPart, 5 );
The value of '5' in AddWithRefs() is not what I eventually want, but I don't know what to put there. Since there is no documentation for this low level function, I am just trying to decide what it does.
Eventually I want to be able to add boolean, integer, floating point and character data to the file as well. Can anyone please tell me how to do this?
-- Shaun Bloom