DiscussionsIssue archiveData Exchange and Application Framework

Archived discussion

StepWriter appends number to productname

Data Exchange and Application FrameworkMon, 06/02/2025 - 11:471 reply

Browse this forum
QuestionAuthor

Hello,

I have an application that creates step files with productnames:

	std::ostringstream outputStream;

	STEPControl_Writer writer;

	Interface_Static::SetCVal("write.step.product.name", productName.c_str());

	IFSelect_ReturnStatus transferStatus = writer.Transfer(shape, STEPControl_AsIs);
	if (transferStatus != IFSelect_RetDone)
		return "";

	IFSelect_ReturnStatus writeStatus = writer.WriteStream(outputStream);
	if (writeStatus == IFSelect_RetDone)
		return outputStream.str();

However, the stepwriter add a number to the end of the productname (I used productName = "myProductName"):

#7 = PRODUCT('myProductName 1','myProductName 1','',(#8));

Is there any way to prevent the stepwriter from doing this?

(OpenCascade version 7.9.0)

Thanks in advance,

Author

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

Hello. It can't be changed natively. The one of the option - you can iterate under the created model tree and extract all PRODUCT entity and change their name manually.

  // get starting data
  const Handle(Interface_InterfaceModel)&  Model = WS->Model();

  for (Standard_Integer i = 1; i <= nb; i++)
  {
    Handle(Standard_Transient) enti = Model->Value(i);
   }

But if you want to change the implementation, the code responsible for the naming here:

https://github.com/Open-Cascade-SAS/OCCT/tree/master/src/DataExchange/TK...

Best regards, Commenter-1.